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)

player.set_velocity(vx, vy, vz) [BETA]

Set the player Character full XYZ velocity.

Arguments

Three finite numbers.

Returns

nil.

Works with

Active Player Character.

Missing values and errors

Invalid arguments raise an error; getters may return nil without a Player.

player.set_velocity(0, 3, 0)

player.get_velocity() [BETA]

Get the player Character velocity.

Arguments

No arguments.

Returns

Three-number basket or nil.

Works with

Active Player Character.

Missing values and errors

Invalid arguments raise an error; getters may return nil without a Player.

const v = player.get_velocity()

player.set_gravity_scale(scale) [BETA]

Set the player Character gravity multiplier.

Arguments

Finite number between -100 and 100.

Returns

nil.

Works with

Active Player Character.

Missing values and errors

Invalid arguments raise an error; getters may return nil without a Player.

player.set_gravity_scale(0.5)

player.get_gravity_scale() [BETA]

Read the player Character gravity multiplier.

Arguments

No arguments.

Returns

Number or nil.

Works with

Active Player Character.

Missing values and errors

Invalid arguments raise an error; getters may return nil without a Player.

const scale = player.get_gravity_scale()

player.set_controller_enabled(enabled) [BETA]

Enable or disable native Character control.

Arguments

Boolean.

Returns

nil.

Works with

Active Player Character.

Missing values and errors

Invalid arguments raise an error; getters may return nil without a Player.

player.set_controller_enabled(false)

player.is_controller_enabled() [BETA]

Read the native movement Controller state.

Arguments

No arguments.

Returns

Boolean.

Works with

Active Player Character.

Missing values and errors

Invalid arguments raise an error; getters may return nil without a Player.

const enabled = player.is_controller_enabled()

player.is_swimming() [BETA]

Check whether the Player is swimming.

Arguments

No arguments.

Returns

Boolean.

Works with

Active Player Character.

Missing values and errors

Invalid arguments raise an error; getters may return nil without a Player.

if player.is_swimming() { debug.log("Swimming") }

player.is_valid() [BETA]

Check whether the current Player Actor is available.

Arguments

No arguments.

Returns

Boolean.

Works with

The active Player Actor.

Missing values and errors

Returns false if there is no active Player Actor.

if player.is_valid() { debug.log("Player ready") }