21 lines
531 B
C#
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);
|
|
}
|
|
}
|
|
} |