Search Unity

Tutorial - How to Implement a Touch Movement Joystick Using the New Input System

Discussion in 'Community Learning & Teaching' started by ChrisKurhan, Aug 23, 2022.

  1. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    268


    Hey all! Happy #TutorialTuesday!

    Making a mobile game that needs movement? Learn how to add a Movement Joystick with Unity's New Input System Enhanced Touch API!

    This week you can learn how to add a Touch Movement Joystick to control your player using the New Input System. We'll specifically look at how to do that with a NavMeshAgent, but the same concept can be applied to Rigidbody movement or a CharacterController. In this tutorial you'll learn the full end to end process of Joystick Creation, Canvas Setup, & Code, along with some of the "gotchas" I learned when implementing my own mobile game so you don't have to run into the same struggles!

    The Enhanced Touch API raises events
    onFingerDown, onFingerMove, onFingerUp
    events to us when the user touches, moves, or lets go of the screen. It keeps track of which finger is doing what, so we can track each finger separately.

    As always, the full project code is available on GitHub for you to play around with.