In the new Input System, is there a way to check if an Input Action is being performed?
I’ve found that if I do this controlScheme.Player.MyAction.activeControl
it returns null if the action is not performimg.
There are other ways, but the simplest get button state of a gamepad is like this:
using UnityEngine.InputSystem;
Gamepad gamepad = Gamepad.current;
if (gamepad != null)
{
if (gamepad.buttonSouth.isPressed)
{
Debug.Log("Button down");
}
if (gamepad.rightTrigger.ReadValue() > 0.5f)
{
Debug.Log("Trigger down");
}
}