Space Short Monthly: “New” Input System in Unity Part II
Using both keyboard and touch for movement in the new input system in Unity — Touch
Notice: I will not publish new stories during August. See you again in September!
In the previous article, we covered using arrow keys to move a player using Unity’s new Input System. In this article, we will add touchscreen movement (dragging and tapping) and switching between the modes.
Again, I highly recommend the following tutorials which helped me get started: gameDevBeginner and samyam.
Adding touch input to the map
In the previous article, we arrived at the following Move
Action map:
Now we add the Touch movement (dragging) to the map. We have one unbound entry (if you don’t, simply add it using the +
in the Move
row). Click on it. In the Path
value, choose Position(Touchscreen)
(you can search for it). Also, mark that it’s part of the Touch
scheme:
Excellent!