Hey folks,
as I’m new into the new Input System, this problem is causing me a severe headache:
When I press a button dedicated to an Input Action, it fires three times (as performed!).
Here’s the script that listens to Input Actions and fire’s a Debug.Log
[SerializeField]
private PlayerInput playerInput;
private PlayerControlActions playerControlActions;
private void Awake()
{
if (playerInput == null)
{
playerInput = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerInput>();
}
playerControlActions = new PlayerControlActions();
playerControlActions.Player.Enable();
playerControlActions.Player.Ability1Charge.performed += OnAbility1Fire;
}
void OnAbility1Fire(InputAction.CallbackContext context)
{
if (context.performed)
{
Debug.Log("Ability1Charge: " + context.phase);
}
On runtime, when I press the dedicated button (T-Key) ONCE, it gives me this output:
This is my PlayerInputActions Asset (saved as C#-Asset named “PlayerControlActions”
The problem does not occur when checking Gamepad.current.buttonWest.wasPressedThisFrame
in Update()
Has anyone seen this happening before?
I already double-checked if there are any other Player Input Components present in the scene.
Best regards