How can I add a 2D joystick UI to a 3D game in Godot?

I’m working on a 3D game in Godot, and I want to add a mobile-style joystick to control the player character.

What’s the proper way to add a 2D joystick (like with Control or CanvasLayer) in a 3D game scene?

Also, how can I connect the joystick input to a CharacterBody3D to move it around based on the joystick direction?

I tried using TouchScreenButton, but it didn’t really work well for continuous input like a joystick.

Any tips, code examples, or demo projects would be really appreciated :folded_hands:

Thanks in advance!

For Godot 4.4.1

You can check the Godot Asset Library for touch joysticks.

Hey! I tried installing some joystick assets from the Godot Asset Library, but my Godot gives errors when I load them.
Not sure if it’s because of version differences or something else.
Have you had a similar issue before?