How to implement idle state with input system

Hi Guys,

I am new to the Input System and was wondering: How can check for the absence of input? I want to implement an idle behaviour using the new Input System but my limited understanding of how this works is not letting me go beyond this simple task. So far I have sucessfully implemented movement and jump actions, these are bound to methods in a game controller script with same names. These methods invoke an event to which a player character is subscribed. This all means that every time I press a button, an event to start moving or making the player jump will be invoked, but detecting when NO input is received is my problem.

I know I can simply declare a bool variable and check wheter its value is false or true depending on whether one of the aforementioned event has been invoked in the update, but I want to avoid that because this means that, as a start adding more actions (moves, abilities, etc) my idle animations and behaviours will depend more and more on whether I checked if either of those actions have been actuated or not.

I’d appreciate your help.

1 Like

Create an Idle action, set its binding to ‘Any Key’ and subscribe to its ‘canceled’ event.