Mover - stingray.Mover object reference - Stingray Lua API Reference

Description

Provides an interface to a physics mover / character controller.

Collision results

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Actor

The actor that was last collided with in the downward direction.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

Returns true if the mover collides in the downward direction, or false otherwise.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

Returns true if the mover collides in a horizontal direction, or false otherwise.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

Returns true if the mover collides in the upward direction, or false otherwise.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

integer

The number of frames the mover has been flying.

This function returns 1 for the first frame the mover is flying.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

integer

The number of frames the mover has been standing.

The mover is considered to be "standing" if it is colliding downward with a walkable surface: a surface whose slope is less than the maximum slope value set for the Mover.

This function returns 1 for the first frame the mover is standing.

Controlling Mover behavior

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The maximum slope angle set for the mover, in radians.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

filter :

string

The new collision filter to set for the mover.

Returns
This function does not return any values.
Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

slope :

number

The new maximum slope angle to set for the mover, in radians.

Returns
This function does not return any values.

Positioning

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

position :

stingray.Vector3

The position to place the mover.

allow_move :

number?

If non-zero, specifies the distance to search for a non-colliding position.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

boolean

Returns true if the mover fits at the position, or false otherwise.

stingray.Vector3?

If a non-colliding position was found, it is returned as the second paramter.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

offset :

stingray.Vector3

The vector along which the mover slides.

delta_time :

number

The delta time in seconds. Used to resolve interactions with kinematic platforms.

Returns
This function does not return any values.

The mover will slide against physical objects.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The position of the mover.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The radius of the mover.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

allow_move :

number?

If non-zero, specifies the distance to search for a non-colliding position.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

boolean

True if the mover is colliding in the start position.

stingray.Actor?

The actor that the mover is colliding with in the start position.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

stingray.Vector3?

If the collision can be resolved by moving the mover a distance below allow_move, this is the distance the mover needs to move to resolve the collision.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

stingray.Vector3?

If the collision can be resolved by moving the mover, this is the mover's final position.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

Note that this function will not actually move the mover, you need to call move() to do that.

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

pos :

stingray.Vector3

The position to reach.

Returns
This function does not return any values.

Setup

Parameters

self :

stingray.Mover

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Unit

The Unit that owns the mover.