Skip to content

Components

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

FieldScript nameKindDefaultWhat it does
ActionactiontextmoveReported with the direction this stick produces.
Dead Zonedead_zonenumber, 0 to 0.9, step 0.010.15Fraction of the radius ignored around the centre.