new input actions, basic onmove function that logs input values
This commit is contained in:
24
Assets/Scripts/PlayerMovement.cs
Normal file
24
Assets/Scripts/PlayerMovement.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user