feat: player can look around on all axis

This commit is contained in:
2026-02-24 09:50:15 +01:00
parent 44e13f4837
commit fe7550d9e2
1839 changed files with 112504 additions and 3767 deletions

View File

@@ -8,10 +8,6 @@ public class PlayerMovement : MonoBehaviour
private InputMaster _inputMaster;
[SerializeField] private CharacterController controller;
[SerializeField] private float speed;
[SerializeField] private float mouseSensitivity = 20f;
[SerializeField] private Transform playerBody;
private float _mouseX, _mouseY;
private Vector2 _moveDirection;
@@ -19,18 +15,9 @@ public class PlayerMovement : MonoBehaviour
{
controller = GetComponent<CharacterController>();
_inputMaster = new InputMaster();
_inputMaster.Player.Look.Enable();
_inputMaster.Player.Move.Enable();
}
private void Update()
{
var mousevalue = _inputMaster.Player.Look.ReadValue<Vector2>();
_mouseX = mousevalue.x * mouseSensitivity * Time.deltaTime;
_mouseY = mousevalue.y * mouseSensitivity * Time.deltaTime;
playerBody.Rotate(Vector3.up * _mouseX);
}
public void OnMove(InputAction.CallbackContext context)
{
_moveDirection = context.ReadValue<Vector2>();