Joystick In Godot 4 (with mobile test)

Channel:
Subscribers:
3,830
Published on ● Video Link: https://www.youtube.com/watch?v=YlHn5drvD2s



Duration: 0:00
414 views
23


A simple video showing how to make a functional joystick in Godot 4.0 using simple vector math and autoloads/singletons. You'll see the joystick in action on an Android device PLUS this is my first video with a handcam!

The implementation here relies on autoloads and basic vector math, making it both efficient and easy to follow. Code snippets are included below to help you get started quickly!

I've also added links to:
Resources for working with autoloads, there are other videos but this is the "original" document for many:
https://gameprogrammingpatterns.com/singleton.html
My older Godot 3 video, where I dive into clamping for joystick controls.
Whether you're upgrading from Godot 3 or new to joystick creation, this video has you covered.


Check it out, and don’t forget to like, comment, and subscribe for more Godot content!


Chapters:
0:00 - Introduction
0:21 - Start making the Joystick
0:56 - How A Joystick Works in Paint
2:10 - Start making the Joystick (cont.d)
5:56 - Programming the joystick
7:58 - Setting up Inputs
11:10 - Making a player to move via the joystick
13:26 - Making an Autoload
15:02 - Moving the player from Autoload + Joystick
16:00 - Extending the joystick
17:33 - Stopping the joystick
19:22 - Trying it on Android


Code:
https://github.com/aimforbigfoot/NAD-LAB-Godot-Projects-4.0/tree/main/joystickgodot4tut