VaelisDocs
v1.0.0
Components · v1.0.0

Joystick

Vaelis 1.0.0 Joystick component reference: fields, script API, behavior and examples.

View as Markdownllms.txt
ScopeThis page documents the Joystick component in Vaelis 1.0.0. Runtime fields are serialized scene data; the Script API section lists only members intentionally exposed to game scripts.
Where to find it in the editorTop UI → Joystick, or Inspector → Add Component → Joystick.

#What it does

Virtual touch joystick for mobile and pointer-driven control schemes.

Component setup & editor toolsJoystick provides a touch/drag virtual control for mobile-oriented input.

#How to add and use Joystick

Editor path: Select the target entity in the Hierarchy (left side) → look at the Inspector (right side) → click Add Component at the bottom of the Inspector → search for Joystick → click the component row. The Add Component picker is a centered modal with a search box; it only lists components not already attached.

For components with a dedicated editor tool, the tool is opened or activated from the location described below. Do not assume that adding the component alone activates its editor; some systems require a separate window, panel, or viewport tool.

#Component setup & editor tools

  • GameObject → UI → Joystick creates a joystick entity. You can also select an entity → Inspector → Add Component → Joystick.

#What you should see after adding it

The component appears as its own section in the Inspector. Its serialized settings are listed in the Component data table below. If a field is conditional, it appears only when the relevant mode/type is selected. If a field is a runtime state field (for example grounded or resolved velocity), treat it as read-only diagnostic state unless the API reference explicitly documents it as writable.

#How to read the settings

For every setting below, the documentation distinguishes type, default, meaning, and tuning direction where behavior is known. When a value represents a direction, use the engine's coordinate convention documented in Coordinate system; do not substitute Unity/Godot conventions.

#Component data

FieldTypePurposeDefault
positionModeenumFixed or pointer-positioned joystick.Fixed
regionXnumberRegion X.0
regionYnumberRegion Y.0
regionWidthnumberRegion width.640
regionHeightnumberRegion height.720
baseRadiusnumberBase radius.60
knobRadiusnumberKnob radius.28
baseColorhex stringBase color.#ffffff
baseOpacitynumberBase opacity.0.25
knobColorhex stringKnob color.#ffffff
knobOpacitynumberKnob opacity.0.6
outlineColorhex stringOutline color.#ffffff
outlineWidthnumberOutline width.2
deadZonenumberInput dead zone.0.1
returnToCenterbooleanKnob returns to center when released.true
hideWhenIdlebooleanHide when idle.false
idleOpacityMultipliernumberOpacity multiplier while idle.0.35
xnumberWritten by the engine each frame; not an authored setting. (engine-managed runtime state)0
ynumberWritten by the engine each frame; not an authored setting. (engine-managed runtime state)0
magnitudenumberWritten by the engine each frame; not an authored setting. (engine-managed runtime state)0
anglenumberWritten by the engine each frame; not an authored setting. (engine-managed runtime state)0
activebooleanWritten by the engine each frame; not an authored setting. (engine-managed runtime state)false
baseScreenXnumberWritten by the engine each frame; not an authored setting. (engine-managed runtime state)0
baseScreenYnumberWritten by the engine each frame; not an authored setting. (engine-managed runtime state)0

#Tuning behavior

These are the practical direction-of-change rules for the most important controls on this component.

SettingWhat changing it does
deadZone0 means even tiny stick displacement is reported; increasing it keeps small movements at zero until the knob moves farther.
baseRadius / knobRadiusLarger values make the on-screen joystick physically larger.
idleOpacityMultiplierLower makes an idle joystick more transparent when hideWhenIdle is false.
returnToCenterTrue snaps back on release; false preserves the last knob position.

#Script API

MemberKindDescription
xPropertyNormalized horizontal input, typically -1..1 (read-only).
yPropertyNormalized vertical input, typically -1..1 (read-only).
magnitudePropertyInput magnitude (read-only).
anglePropertyInput angle (read-only).
activePropertyWhether the joystick is engaged (read-only).
positionModePropertyJoystick positioning mode.
regionXPropertyTouch/pointer region X.
regionYPropertyTouch/pointer region Y.
regionWidthPropertyRegion width.
regionHeightPropertyRegion height.
baseRadiusPropertyBase radius.
knobRadiusPropertyKnob radius.
deadZonePropertyDead-zone threshold.
returnToCenterPropertyReturn-to-center behavior.
baseColorPropertyAvailable on this module.
baseOpacityPropertyAvailable on this module.
hideWhenIdlePropertytrue = invisible until actively being dragged.
idleOpacityMultiplierPropertyAvailable on this module.
knobColorPropertyAvailable on this module.
knobOpacityPropertyAvailable on this module.
outlineColorPropertyAvailable on this module.
outlineWidthPropertyAvailable on this module.

#Examples

js
this.rigidbody.velocityX = this.joystick.x * 250;
Need the full workflow?Components: complete workflow covers adding, configuring, testing, combining, and removing components.