How to detect if a button is pressed using the new input system?

I just started learning Unity a month ago and today I realized that I was using an old input system whenever I create a script for player movement.

I searched up how to use the new input system in Youtube and somehow I managed to create a really simple 2d movement as I basically copied the entire script, but I still don’t understand how to detect a single press on a button which acts like Input.GetButtonDown(); in the old input system.
I tried using .ReadValue<bool> to get a boolean value when I press a key which I thought was incredibly stupid

==========================
What code do I have to write to detect if a button is pressed?
My player capsule is such a that he can’t even jump.

I would check the documentation. Specifically the “How do I” section, which covers a lot of these common questions: How do I…? | Input System | 1.13.1

If you’re using the PlayerInput component, then read its documentation here: The Player Input component | Input System | 1.13.1

1 Like