Skip to content
AEOWUN
Docs Menu

Actor handles

Look up Actor calls and properties. Here actor stands for a handle found with proj.find().

actor.id

Read the authored Actor ID.

Arguments

No call arguments. Read this property.

Returns

number. Read-only.

Works with

actor handles.

Missing values and errors

Assigning to this property is not supported. Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.id)
}

actor.actor_id

Read the authored Actor ID.

Arguments

No call arguments. Read this property.

Returns

number. Read-only.

Works with

actor handles.

Missing values and errors

Assigning to this property is not supported. Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.actor_id)
}

actor.is_actor

Check the authored Actor kind.

Arguments

No call arguments. Read this property.

Returns

bool. Read-only.

Works with

actor handles.

Missing values and errors

Assigning to this property is not supported. Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.is_actor)
}

actor.name

Read the Actor name.

Arguments

No call arguments. Read this property.

Returns

string. Read-only.

Works with

actor handles.

Missing values and errors

Assigning to this property is not supported. Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.name)
}

actor.position

Read or change the Actor position.

Arguments

No call arguments. Assign [x, y, z] numbers to change it.

Returns

[x, y, z] numbers. Readable and writable.

Works with

actor handles.

Missing values and errors

Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.position)
}

actor.rotation

Read or change Actor rotation.

Arguments

No call arguments. Assign [x, y, z] numbers to change it.

Returns

[x, y, z] numbers. Readable and writable.

Works with

actor handles.

Missing values and errors

Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.rotation)
}

actor.scale

Read or change Actor scale.

Arguments

No call arguments. Assign [x, y, z] numbers to change it.

Returns

[x, y, z] numbers. Readable and writable.

Works with

actor handles.

Missing values and errors

Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.scale)
}

actor.visible

Show or hide the Actor.

Arguments

No call arguments. Assign bool to change it.

Returns

bool. Readable and writable.

Works with

actor handles.

Missing values and errors

Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.visible)
}

actor.enabled

Enable or disable the Actor.

Arguments

No call arguments. Assign bool to change it.

Returns

bool. Readable and writable.

Works with

actor handles.

Missing values and errors

Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.enabled)
}

actor.package

Read the Actor package name.

Arguments

No call arguments. Read this property.

Returns

string. Read-only.

Works with

actor handles.

Missing values and errors

Assigning to this property is not supported. Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.package)
}

actor.attributes

Read the Actor attributes.

Arguments

No call arguments. Read this property.

Returns

map. Read-only.

Works with

actor handles.

Missing values and errors

Assigning to this property is not supported. Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.attributes)
}

actor.facing

Read the Actor facing direction.

Arguments

No call arguments. Read this property.

Returns

[x, z] numbers. Read-only.

Works with

actor handles.

Missing values and errors

Assigning to this property is not supported. Removed objects and unsupported handle kinds cannot supply this property.

const actor = proj.find("Guard")
if actor != nil {
    debug.log(actor.facing)
}

actor.is_valid()

Check whether the object still exists.

Arguments

No arguments.

Returns

bool. False if removed.

Works with

Actor handles.

Missing values and errors

A removed object returns false. Wrong argument counts or types report an error.

const object = proj.find("Guard")
if object != nil {
    debug.log(object.is_valid())
}

actor.name()

Read the object name.

Arguments

No arguments.

Returns

string.

Works with

Actor handles.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const object = proj.find("Guard")
if object != nil {
    debug.log(object.name())
}

actor.set_position(x, y, z)

Set the object position.

Arguments

Three numbers: x, y, z.

Returns

nil.

Works with

Actor handles.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const object = proj.find("Guard")
if object != nil {
    object.set_position(0, 2, 0)
}

actor.translate(x, y, z)

Move the object by an offset.

Arguments

Three numbers: x, y, z.

Returns

nil.

Works with

Actor handles.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const object = proj.find("Guard")
if object != nil {
    object.translate(1, 0, 0)
}

actor.destroy()

Destroy the live object.

Arguments

No arguments.

Returns

true.

Works with

Actor handles.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const object = proj.find("Guard")
if object != nil {
    object.destroy()
}

actor.set_horizontal_velocity(vx, vz)

Set horizontal movement speed.

Arguments

Two numbers: x and z velocity.

Returns

nil.

Works with

Actor handles with the required runtime movement support.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const actor = proj.find("Guard")
if actor != nil {
    actor.set_horizontal_velocity(2, 0)
}

actor.set_facing_direction(dx, dz)

Set the direction the Character faces.

Arguments

Two numbers: x and z direction.

Returns

nil.

Works with

Actor handles with the required runtime movement support.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const actor = proj.find("Guard")
if actor != nil {
    actor.set_facing_direction(1, 0)
}

actor.select_animation(name)

Choose a Character animation.

Arguments

Animation name string.

Returns

nil.

Works with

Actor handles with the required runtime movement support.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const actor = proj.find("Guard")
if actor != nil {
    actor.select_animation("Walk")
}

actor.is_grounded()

Check whether the Character is on the ground.

Arguments

No arguments.

Returns

bool.

Works with

Actor handles with the required runtime movement support.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const actor = proj.find("Guard")
if actor != nil {
    actor.is_grounded()
}

actor.apply_vertical_impulse(impulse)

Apply upward or downward movement.

Arguments

One number: vertical impulse.

Returns

nil.

Works with

Actor handles with the required runtime movement support.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const actor = proj.find("Guard")
if actor != nil {
    actor.apply_vertical_impulse(5)
}

actor.navigate_to(position [, speed [, stop_distance]]) [BETA]

Ask the engine to move an Actor along a route.

Arguments

position: [x, y, z]. Speed defaults to 4.0; stop distance defaults to 0.1.

Returns

true when a route starts. false if it cannot start.

Works with

Movable Actors with runtime navigation support.

Missing values and errors

No path emits navigation_failed(actor, reason). Invalid targets, speed, or stop distance report an error. Completion emits navigation_finished(actor).

const guard = proj.find("Guard")
if guard != nil {
    debug.log(guard.navigate_to([12, 0, 8], 3.5, 0.25))
}

actor.cancel_navigation() [BETA]

Cancel the current navigation request.

Arguments

No arguments.

Returns

Whether an active request was cancelled.

Works with

Actor handles.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const guard = proj.find("Guard")
if guard != nil {
    debug.log(guard.cancel_navigation())
}

actor.is_navigating() [BETA]

Check whether the Actor has an active route.

Arguments

No arguments.

Returns

bool.

Works with

Actor handles.

Missing values and errors

Use a valid handle. Wrong argument counts or types report an error.

const guard = proj.find("Guard")
if guard != nil {
    debug.log(guard.is_navigating())
}

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