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, and 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: https://github.com/llamacademy/mobile... for you to play around with.
🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?sect...
📚 Resources
⚫ Enhanced Touch: https://docs.unity3d.com/Packages/com...
⚫ Unity Manual for Touch Input: https://docs.unity3d.com/Packages/com...
🧡 Believe in LlamAcademy's mission and have received value from the videos? Here's how you can show your support:
🌟 Patreon: / llamacademy
🌟 YouTube Member: / @llamacademy or click the Join button on any video
📚 Take my Unity ShaderGraph Course:
https://www.gamedev.tv/p/unity-shader...
👕 Get yourself some LlamAcademy merch: https://llamacademy.myspreadshop.com/
💸 Use my Affiliate Link for Humble Bundles https://humblebundleinc.sjv.io/9g4ak4
💸 Publisher Sale! 50% OFF an entire publisher's Assets! Publisher changes weekly! https://assetstore.unity.com/publishe... (affiliate)
💸 Save up to 50% on NEW Assets: https://assetstore.unity.com/?new_sal... (affiliate)
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
Chapters:
00:00 Adding Touch Input Support - High Level Overview
02:32 Creating your Joystick & Canvas Setup
04:18 Quick Scene Overview & Enable Virtual Touch
05:12 References & FloatingJoystick.cs Review - PlayerTouchMovement.cs
06:44 Enable Touch Support & Add/Remove Event Listeners - PlayerTouchMovement.cs
07:30 HandleFingerDown - PlayerTouchMovement.cs
09:46 HandleFIngerMove - PlayerTouchMovement.cs
11:10 HandleLoseFinger - PlayerTouchMovement.cs
11:44 Actually Moving the Player - PlayerTouchMovement.cs
13:32 Demo & Thoughts on Player Rotation
Watch video Touch Movement Joystick Using the New Input System | Unity Tutorial online without registration, duration hours minute second in high quality. This video was added by user LlamAcademy 23 August 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 32,946 once and liked it 699 people.