Skip to content
AEOWUN
Docs Menu

Input

Look up input calls and properties.

player.set_horizontal_velocity(vx, vz)

Set horizontal movement speed.

Arguments

Two numbers: x and z velocity.

Returns

nil.

Works with

The active Player.

Missing values and errors

Wrong argument counts or types report an error.

player.set_horizontal_velocity(2, 0)

player.set_facing_direction(dx, dz)

Set the direction the Character faces.

Arguments

Two numbers: x and z direction.

Returns

nil.

Works with

The active Player.

Missing values and errors

Wrong argument counts or types report an error.

player.set_facing_direction(1, 0)

player.select_animation(name)

Choose a Character animation.

Arguments

Animation name string.

Returns

nil.

Works with

The active Player.

Missing values and errors

Wrong argument counts or types report an error.

player.select_animation("Walk")

player.is_grounded()

Check whether the Character is on the ground.

Arguments

No arguments.

Returns

bool.

Works with

The active Player.

Missing values and errors

Wrong argument counts or types report an error.

player.is_grounded()

player.apply_vertical_impulse(impulse)

Apply upward or downward movement.

Arguments

One number: vertical impulse.

Returns

nil.

Works with

The active Player.

Missing values and errors

Wrong argument counts or types report an error.

player.apply_vertical_impulse(5)

input.get_move_vector()

Read movement input.

Arguments

No arguments.

Returns

[x, z] numbers.

Works with

Current gameplay input.

Missing values and errors

This reads current state; a top-level read does not keep polling.

debug.log(input.get_move_vector())

input.is_jump_pressed()

Read jump input.

Arguments

No arguments.

Returns

bool.

Works with

Current gameplay input.

Missing values and errors

This reads current state; a top-level read does not keep polling.

debug.log(input.is_jump_pressed())

input.get_orbit_delta()

Read camera orbit input.

Arguments

No arguments.

Returns

Two numeric orbit values.

Works with

Current gameplay input.

Missing values and errors

This reads current state; a top-level read does not keep polling.

debug.log(input.get_orbit_delta())

input.is_key_down(key)

Check whether a physical key is held.

Arguments

key: string, such as "F", "1", "Space", or "ArrowUp".

Returns

bool. False when the key is not held.

Works with

Current gameplay input.

Missing values and errors

Wrong argument counts or types report an error.

debug.log(input.is_key_down("F"))

get.mouse()

Get the runtime mouse controls.

Arguments

No arguments.

Returns

Mouse handle.

Works with

The active mouse input.

Missing values and errors

Wrong argument counts or types report an error.

const mouse = get.mouse()
mouse.setCursorVisible = false
mouse.setScreenLocked = true

mouse.setCursorVisible

Show or hide the cursor.

Arguments

No call arguments. Assign bool to change it.

Returns

bool. Readable and writable.

Works with

mouse handles.

Missing values and errors

Removed objects and unsupported handle kinds cannot supply this property.

const mouse = get.mouse()
mouse.setCursorVisible = false

mouse.setScreenLocked

Lock or unlock the mouse.

Arguments

No call arguments. Assign bool to change it.

Returns

bool. Readable and writable.

Works with

mouse handles.

Missing values and errors

Removed objects and unsupported handle kinds cannot supply this property.

const mouse = get.mouse()
mouse.setScreenLocked = true

player.position

Read the active Player position.

Arguments

No arguments.

Returns

[x, y, z] numbers.

Works with

The active Player.

Missing values and errors

Requires an active Player. Actor and Entity property controls are separate from this namespace property.

debug.log(player.position)

[BETA] marks features newer than the current public release. Current release: 0.8.0.