I'm working on a game at the moment, and am wanting to implement something that alot of games actually do. The Long Dark for example (made in Unity) can do it, so I should also be able to!
What I want, is when the players RayCast hits an interactable object (already achieved), I want it to come up with text saying "Interact, etc...", but also have an image of whatever key that the interact button is bound to.
I'm sure I can just have a folder with all the seperate images of each key I want and name them according to the key they represent, but then how do I actually get the key from the input manager?
A really good example of this is the Valve games, they do it all the time:
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
3 People are following this question.
Text.Field erratically updating
Creating a menu for gamepad?
Inputhandling is giving different results for left and right (arrows, ctrl's , shifts) but my code seems fine
Custom Input manager problem
Unity not recognizing Saitek p880 gamepad?