Browse docsoutput.set_stick
On this page
API method

output.set_stick

Overrides X and, when supplied, Y on the left or right stick for this packet.

Syntax

Atlas Script
output.set_stick(stick, x, y?)

Parameters

stick
Stick selector that identifies the stick to read or change.
x
Horizontal component or X coordinate for the requested operation.
y Optional
Vertical component or Y coordinate for the requested operation.

Return value

See the remarks for the returned value and runtime behavior.

Remarks

Overrides X and, when supplied, Y on the left or right stick for this packet. Values clamp to -100 through 100. With only stick and x, only X is touched.

Examples

Add gyro movement to the right stick.atlas
event on_input() {
    if (gyro.available) {
        var x = math.clamp(input.right_x + gyro.y * 12, -100, 100);
        var y = math.clamp(input.right_y - gyro.x * 12, -100, 100);
        output.set_stick("right", x, y);
    }
}
Reference details are generated from the Atlas Script schema in this documentation source snapshot. Confirm release-specific behavior in the Atlas for Windows build you use.