Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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


    Dec 28, 2015

    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.