VirtualStick
An on-screen thumbstick for a touch screen, reporting a direction the same way a gamepad stick would. A touch inside the dead zone near the centre reports nothing; the direction scales up from there to the edge. Needs a Panel to be seen.
On this page
Add it
+ Add node → Virtual Stick creates a node with it already on. Already have a node for it? Add component → VirtualStickComponent.
From a script
A script on the same node writes these fields by name. VirtualStickComponent is the name to pass.
rgs
set_text("VirtualStickComponent", "action", "move");
set_number("VirtualStickComponent", "dead_zone", 0.15); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Action | action | text | move | Reported with the direction this stick produces. |
| Dead Zone | dead_zone | number, 0 to 0.9, step 0.01 | 0.15 | Fraction of the radius ignored around the centre. |