Files
gpd-924-en/SOLID/Assets/Scripts/Solid/PlayerMovement.cs
T
david a4f498a33d add unity project
add SOLID examples
2025-04-09 07:49:12 +02:00

21 lines
531 B
C#

using UnityEngine;
namespace DefaultNamespace.Solid
{
[RequireComponent(typeof(CharacterController))]
public class PlayerMovement : MonoBehaviour
{
private CharacterController _controller;
private void Awake()
{
_controller = GetComponent<CharacterController>();
}
public void MoveAndRotate(Vector3 movement, float rotation)
{
_controller.Move(movement);
_controller.transform.Rotate(Vector3.up, rotation);
}
}
}