New answers tagged

0

the player has to look at the buttons and click So you have a fixed reticule and you need to aim and click at buttons? Add colliders and raycast to detect hits on the buttons. You can put all of your UI on another layer (maybe name it InWorldUI) and limit your raycasts to that layer and another layer that blocks visibility (so you can't click buttons ...


0

You can interact with the UI with the cursor locked, but cannot use the mouse, only the keyboard, which is indeed not ideal. We all manage the locking/unlocking in code using a state machine approach so that you lock/unlock the cursor depending on the game state. When the player enters a store you unlock the cursor and lock it again when the player leaves ...


0

In the end I solved the problem by switching to the new Input System: I created a dedicated action map for the UI menus (the 'pauseMap') and one for the player control 'playerMap', Whenever I press the start button from the 'playerMap', it activates the menu and now the gamepad buttons are used to move through the menu and press buttons (then each button do ...


1

As you know: button.onClick.Invoke(); Acts like the user has clicked the button, invoking callbacks, but there's no visual effect on the button itself. Do you also want the Selectable to be highlighted as if you'd moused-over it and clicked on it? I.e. a "simulated" click? If so, the following code works for at least Buttons: public static void ...


Top 50 recent answers are included