new input actions, basic onmove function that logs input values

This commit is contained in:
2026-02-16 15:02:20 +01:00
parent 5a4f14ebe0
commit 227f8bde40
3810 changed files with 314088 additions and 7620 deletions

View File

@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerMovement : MonoBehaviour
{
[SerializeField] private CharacterController controller;
[SerializeField] private float speed;
private Vector2 _moveDirection;
private void Awake()
{
controller = GetComponent<CharacterController>();
}
public void OnMove(InputAction.CallbackContext context)
{
_moveDirection = context.ReadValue<Vector2>();
Debug.Log("direction: " + _moveDirection);
}
}