I was wondering if it is possible to retrieve the key that is binded to a specific input in inputmanager and reference that. For example, if the key “E” is binded to interact in inputmanager, my code will display "Press E to interact but if the user changes that input to “F”, the code will say “Press F to interact”. I dont want it to be one static text for a single key because that will not allow the users to use their own inputs that correspond to the text. I tried using Input.GetAxis but that doesnt display the key but instead just says 0 if the key isnt pressed and 1 if it is, not giving me what key is being binded to that specific input. I looked around and couldnt find anything helpful. Any help is appreciated.
interactText.text = “Press " + “(Name Of Key)” + " to interact”;
Anyone can correct me if I’m wrong as they may have FINALLY updated stuff in Unity in regards to Inputs… but for years I’ve been using my own input manager because the built in Unity one is god awful for things just like this.
I also know that several other 3rd party input managers exist for Unity also for this very reason.
This is my personal one:
But like I said, many others exist, and have much better “support” since they’re up on the asset store and the sort. And I even believe Unity has their own input manager somewhere out on github as well… I played with it a few years back and it wasn’t as good as the existing 3rd party ones, but still slightly better than the built in one.
That’s unfortunate how its not possible at all for the built in input manager to do something as simple as this. A while back I purchased an asset called “cInput”, and used it for a project using UFPS where it was already integrated, and I believe it had this capability. I hadn’t kept that in mind and im using the build in input manager on this project so I guess ill have to switch to an external input manager. Thanks for saving me more searching
Yeah, cInput is one of the good 3rd parties. I’ve used it in the past, I liked it. I mainly rolled my own to add a few extra features I wanted… and also just for funsies.