Files
OMG/Assets/Scripts/PlayerMovement.cs

24 lines
582 B
C#
Raw Normal View History

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);
}
}