Add the 'Joystick' node to your scene, connect to the signals and you're good to go!
Test the live demo and features at https://lucajunge.github.io/godot_joystick/build/index.html
- Control your character or something else in your scene
- Customize the joystick textures or use no textures at all
- Configure the names of the input axes for x and y movement
- Fade out the joystick to clear the view to your beautiful scene
- Adapt the fadeout duration and begin
- Interpolate the thumbstick return, either snapping back or gradually moving back to the center
- Change the deadzone to account for small changes in the movement
The plugin is available in the Asset Library for Godot 4.
Search for Joystick
in the Asset Library and click on Download
. After it finished downloading, click Install
on the newly opened window.
Dont forget to enable the plugin in the Project Settings > Plugins > Joystick > ☑ Enable
.
- Clone the repository
git clone https://github.com/LucaJunge/godot_joystick.git
-
Copy the
addons/joystick
to youraddons
folder in your project. -
Enable the plugin in the
Project Settings > Plugins > Joystick > ☑ Enable
.
You can add the
Joystick
as a new node to your scene.
An example scene coud look like this:
You can set some settings for your joystick. Take a look at the inspector to see all available settings.
In your _process()
function get the joystick input axes:
func _process(delta) -> void:
var x : float = Input.get_action_strength("move_x")
var y : float = Input.get_action_strength("move_y")
# Use the input axes
bug.position += Vector2(x,y) * speed * delta
The repository contains a test scene under addons/godot_joystick/Test.tscn
: