Setup (UnityEvents):
public void OnRotationInputBegan (CallbackContext _context)
{
Vector2 _rotationInput = _context.action.ReadValue<Vector2> ();
switch (_context.phase)
{
case InputActionPhase.Started:
Debug.Log ("Started");
break;
case InputActionPhase.Canceled:
Debug.Log ("Canceled");
break;
}
}
With ActionType being a Button (WASD, Run Button, Jump Button) there’s no issue, InputActionPhase.Started triggers at key press and InputActionPhase.Canceled at release, 1 time only.
But when the ActionType is a value (Vector2 _rotationInput) Started and Canceled are being triggered continuosly each frame while the value is changing. It is not behaving as a “start” and an “end” like key presses.
What’s going on?