Click to move with the new input system
Hi,
I find the new input system very interesting and I'd like to give it a go, but it still hard for me to understand exactly how I can create a configuration that would also work with a joystick (or even WASD) and not only with a left mouse button.
In the antique system, we have something like Input.GetMouseButton(0)
and I know the new system has mouse.current
. but I'd like it if my code would not depend specifically on a mouse but something more robust that would work if you, for example, use a gamepad and move with the sticks. Is this possible? Or I've confused the philosophy behind this new package? Can somebody share a very quick configuration of how this should be set up? Pretty much every example I could find always focuses on the keyboard keys.
Thanks,
Valentin
Answer by lclemens · Aug 08, 2020 at 03:43 AM
This video shows how to do movement by creating bindings to WASD, the arrow keys, and a gamepad....
https://youtu.be/HwbbvjzT3qE?t=507
Binding to a joystick to movement would be very similar, except instead of a 2D vector composite, just use a regular binding for Left Stick [Gamepad]. Is that what you were looking for?
Your reply does not address the answer. The video never talks about mouse.
In the question, Valentin asked "I'd like it if my code would not depend specifically on a mouse but something more robust that would work if you, for example, use a gamepad and move with the sticks. Is this possible?"