- Home /
Too subjective and argumentative
World space GUI interaction with just a crosshair and a keyboard
Hi everybody, I'm currently making an FPS, but I ran into a problem. For my game, I need to use some interactable world space GUIs with only static elements like labels and images, and some buttons, so nothing complicated.
The issue is that to make the player interact with the GUI, I need to unhide and unblock the mouse from the center of the screen, which frankly is an awful way of interaction.
Since my FPS features a crosshair, made with an image centered on the screen using an overlay canvas, I was thinking about making the player interact with the GUI by simply aiming to the required button and pressing an interact button on the user's keyboard. The problem is that I actually don't know how to achieve this. Googling around, I read about a trick that consisted in locking the mouse to the center, and then using the left mouse click to interact with the GUI, but I sincerely don't like this option, I think that the users would feel confused by the two functions of the same key (interact and shoot), so I'd prefer to make two different keys, so I can use the same interact key both for the GUI and the interaction with other world objects.
Another trick I read was to write a custom input module to make the Graphics Raycaster trigger when a certain key is pressed, but I have the feeling it would be just time consuming and it would make more troubles than benefits.
So, what would be the best way to make a world GUI interactable with only a crosshair and a key press?
"Best way" questions should rarely make it through moderation I$$anonymous$$HO; the 'final answer', if one is chosen, is highly subjective and might be best for your situation but not others. Please take general design/open-ended questions to the forum.
Follow this Question
Related Questions
GraphicRaycaster UI event issue with Unity v5.2.0bx 1 Answer
Send UI Button Event with key press NOT onClick()??? 2 Answers
Changing the Standalone Input Manager variables 2 Answers
Gui list and color 0 Answers