Some mobile virtual controls for Godot 4.x.
Sample textures are from Kenney.
This asset exists, but I required a few more features.
Virtual Joystick for use on touchscreens to emulate a controller joystick.
The texture for the point / inner texture MUST be smaller than the outline texture.
If you see the following error in your logs, it most likely means that you need to set axis to something other than "Joy Axis Invalid":
Condition "p_axis < JoyAxis::LEFT_X || p_axis > JoyAxis::MAX" is true.
Screenspaces / canvas gesture detector. Reports pan, rotate, and scale gestures.
Supports floating Virtual Joystick. When adding floating Virtual Joystick, make sure to add the path to a pre-configured floating joystick. Node that this is enabled on long presses / clicks, so only one can be visible at a time.
Project Settings -> Input Devices -> Pointing
Make sure to disable all input emulation,
- "Emulate Touch From Mouse"
- "Emulate Mouse From Touch"
- "Enable Long Press as Right Click"
and enable "Pan and Scale Gestures".
For more details, read the corresponding documentation.