New Input - Read 1-9 as hotkeys

So the way you have taken all of the input here with input manager using new input system is 1000 times more clear than the ass backwards way I was introduced to it.

Could you show us how to link the 1-9 keys just as easily without adding them one by one? IE, hitting the 1 key would be linked to move while the 4 key linking to the grenade?

For that you’d need to define those Actions in the input asset, Action1, bound to Key 1, Action2, bound to Key 2, etc.
Then listen to those actions, get the index for that button input, and check if the selected Unit has an action on that index, test the index against the baseActionArray.Length
And that’s pretty much it, then perhaps also add an extra text on the UI visual for each action, when creating just set it to the button number.
Pretty simple and it’s a pretty nice addition!

3 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms