I’m trying to use a gamecube controller to control my game and the player is moving but its very Lerpy. I think it is starting and stoping the move() function each frame that the joystick is held. I can’t seem to find anyone else having this problem and I’ve tried two different methods for movement (one of them a direct copy of a tutorial, but I still have the same issue) The issue is almost certainly with how I am getting and applying the inputs but I have no idea how else to do it. code is below. any help is appreciated!
private void Awake()
{
controls = new PlayerInput();
controls.Gameplay.Jump.performed += context => JumpPressed();
controls.Gameplay.Jump.canceled += context => JumpLetGo();
controls.Gameplay.Move.performed += context => moveInput = context.ReadValue<Vector2>();
controls.Gameplay.Move.canceled += context => moveInput = Vector2.zero;
}
// this is called in fixed update
private void Move()
{
Debug.Log(moveInput.x);
rb.velocity = new Vector2(moveInput.x * moveSpeed, rb.velocity.y);
}