E
E
ENDRAER2021-04-23 10:38:55
Unity
ENDRAER, 2021-04-23 10:38:55

How to make navigation in the menu through the joystick and the D-pad at the same time?

there is a menu in the game, it works fine and without jambs, but there is a small problem that is very annoying, the control menu goes through the eventSystem, it uses only horizontal and vertical, it’s convenient in principle, the joystick works on the gamepad and wasd on the keyboard, but you need more and dpad, after all, it's not convenient to navigate the menu with a joystick, to put it mildly, how to navigate the menu through a joystick and a crossbar at the same time?
maybe a bonny question, but I didn’t find an answer either on the Internet or in English

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
i__egor, 2021-04-23
@i__egor

I think the control in such cases needs to be collected separately (do not write in the code like if(Input.GetKey.... {your actions}), but for example, you create a separate class (for example, Controller), in it you collect everything that will be needed in the game in dictionaries or bool[] (each update before all gameobjects where it is collected), in the same place after that you create additional inputs (for example, if the joystick is up OR W is pressed, then set true in the "menu-up" input), and in the right place you write, for example ( if(Controller.Get(Controller.TypeControl.Menu_Up)){your actions}
well, in my game something like this) in my game I can so easily change controls on the fly (keyboard, joystick, + anything) and reassign keys

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question