I’ve set up a very basic example where the “Fire” action from the example prints a message. “One” is subscribed to the performed-Event and “Two” is connected through the Player Input Component:
Shouldn’t these be exactly the same? Why is “Two” printed twice when I press the button and a third time when I release it, but “One” only prints once when I press the button down?
Inputexample actions;
private void OnEnable()
{
actions = new Inputexample();
actions.Enable();
actions.Player.Fire.performed += One;
}
public void One(InputAction.CallbackContext context)
{
Debug.Log("One");
}
public void Two(InputAction.CallbackContext context)
{
Debug.Log("Two");
}