How can I rebind the controls?

yt2389

New member
Hi there, I implemented the Inventory system into my game and I would like to know how to rebind the controls.
For instance, by default, pressing the "I" key will open the Main Menu screen (Saving/loading). I would like to rebind the main menu screen to the 'Tab' key.
Where should I look in the editor? And what should I do? I also intend to allow the player to navigate the hotbar horizontally by scrolling up/down or the left/right d-pad on a game-pad.

Thank you.
 
The inputs are define on multiple components, we usually call them Handlers.
Here you can find the ones you are intersted in, and change the input name to whatever you want. Or change the input the which the input name is assigned to in the Input system of your choice


For scrolling through the Hotbar, I'm afraid you'll have to write some custom code for it. By default all our UI uses the Unity UI input. which can only select one gameobject at a time and uses the left/right/up/down arrow keys to navigate the UI.
That being said writing that cusotm script shouldn't be too hard, as the ItemViewSlots are Unity Selectables, like any Unity UI, so any tutorial you find online about UI will apply.
I hope that helps
 
Thanks for the fast response! Yeah I did a little digging and I think I found what I was looking for.
1666004316869.png
I will get back to you later, thanks again!
 
Okay I made the changes to the key bindings by rebinding the open panel from the "I" to the "Tab" key, and it still doesn't work. Can you provide a step by step demonstration? I'm using the unity's new input system by the way.
 
Have you followed the integration steps for using the new input system?

 
1666254347689.png
Yeah that did it! By following these steps I can finally rebind the key to open the main menu. I went into the characterInput.inputActions file, and renamed the Action Map, 'Gameplay' to 'Player' since that was the only thing unity was complaining about. Thank you so much!
 
Top