Action Button

How does Unity read your gamepad?

It’s straightforward enough to detect actual buttons.  Get the state of the trigger buttons.  When I press an arrow key, move the character.

What does it mean to press the Jump button?

I reworked my code to support actions, or custom button mappings.

When I check for the Jump button, my code converts that to the A button on a gamepad, or Spacebar on a keyboard.

I can now check if the Jump button is pressed, without hard coding what key, button, or axis that might be on specific hardware.

Leave a Reply