Skip to content

Get Sansar

Script API

Mover

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 32.0.0

The Mover handles adding moves to process for an object.

public class Mover : Sansar.Script.InstanceInterface

Remarks

The Movable From Script flag must be set to true in the editor to use the Mover. Additionally, player characters and rigid bodies with Static or Dynamic motion types cannot be moved using the Mover. Unlike the RigidBodyComponent movement functions, the Mover can be applied to objects that do not contain Volumes.

Members at a glance

KindMembers
PropertiesIsMoving · MoveCount
MethodsAddMove New in 47.10.0 · AddMoveOffset New in 47.10.0 · AddPause · AddRotate · AddRotateOffset · AddTranslate · AddTranslateOffset · StopAndClear · ToString

Properties

IsMoving

Added in 32.0.0
public bool IsMoving { get; }

Property to check if a move command is currently executing for this Mover.

Value: bool — Whether or not this object is currently executing a move (includes pauses).

MoveCount

Added in 32.0.0
public int MoveCount { get; }

The number of move commands waiting to be excuted and currently executing for this Mover.

Value: int — The number of enqueued move commands. Includes the current active move and any pause commands.

Methods

AddMove

Added in 32.0.0
public void AddMove(     Sansar.Vector position,     Sansar.Quaternion rotation )

Sets the transform of this Mover to a target World Space position and rotation.

ParameterTypeDescription
positionSansar.VectorThe target position.
rotationSansar.QuaternionThe target rotation.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddMove(     Sansar.Vector position,     Sansar.Quaternion rotation,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sets the transform of this Mover to a target World Space position and rotation.

ParameterTypeDescription
positionSansar.VectorThe target position.
rotationSansar.QuaternionThe target rotation.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddMove(     Sansar.Vector targetPosition,     Sansar.Quaternion targetRotation,     double timeInSeconds,     MoveMode interpolationMode )

Translate and rotate the Mover to the target World Space position and rotation over time.

ParameterTypeDescription
targetPositionSansar.VectorThe target position.
targetRotationSansar.QuaternionThe target rotation.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

New in 47.10.0
public void AddMove(     Sansar.Vector targetPosition,     Sansar.Quaternion targetRotation,     double timeInSeconds,     MoveMode translationMode,     MoveMode rotationMode )

Translate and rotate the Mover to the target World Space position and rotation over time, using separate interpolation modes.

ParameterTypeDescription
targetPositionSansar.VectorThe target world space position.
targetRotationSansar.QuaternionThe target world space rotation.
timeInSecondsdoubleThe shared duration in seconds for translation and rotation.
translationModeMoveModeThe interpolation mode applied to translation only.
rotationModeMoveModeThe interpolation mode applied to rotation only.
Remarks

This asynchronous method queues one combined move command then returns. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddMove(     Sansar.Vector targetPosition,     Sansar.Quaternion targetRotation,     double timeInSeconds,     MoveMode interpolationMode,     Action<Sansar.Script.OperationCompleteEvent> handler )

Translate and rotate the Mover to the target World Space position and rotation over time.

ParameterTypeDescription
targetPositionSansar.VectorThe target position.
targetRotationSansar.QuaternionThe target rotation.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

New in 47.10.0
public void AddMove(     Sansar.Vector targetPosition,     Sansar.Quaternion targetRotation,     double timeInSeconds,     MoveMode translationMode,     MoveMode rotationMode,     Action<Sansar.Script.OperationCompleteEvent> handler )

Translate and rotate the Mover to the target World Space position and rotation over time, using separate interpolation modes.

ParameterTypeDescription
targetPositionSansar.VectorThe target world space position.
targetRotationSansar.QuaternionThe target world space rotation.
timeInSecondsdoubleThe shared duration in seconds for translation and rotation.
translationModeMoveModeThe interpolation mode applied to translation only.
rotationModeMoveModeThe interpolation mode applied to rotation only.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues one combined move command then returns. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to ScriptBase.WaitFor while in a coroutine.

AddMoveOffset

Added in 33.2.0
public void AddMoveOffset(     Sansar.Vector positionOffset,     Sansar.Quaternion rotationOffset )

Sets the transform of this Mover to a target Local Space position and rotation.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset.
rotationOffsetSansar.QuaternionThe local space rotation offset.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddMoveOffset(     Sansar.Vector positionOffset,     Sansar.Quaternion rotationOffset,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sets the transform of this Mover to a target Local Space position and rotation.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset.
rotationOffsetSansar.QuaternionThe local space rotation offset.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddMoveOffset(     Sansar.Vector positionOffset,     Sansar.Quaternion rotationOffset,     double timeInSeconds,     MoveMode interpolationMode )

Translate and rotate the Mover to the target Local Space position and rotation over time.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset.
rotationOffsetSansar.QuaternionThe local space rotation offset.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

New in 47.10.0
public void AddMoveOffset(     Sansar.Vector positionOffset,     Sansar.Quaternion rotationOffset,     double timeInSeconds,     MoveMode translationMode,     MoveMode rotationMode )

Translate and rotate the Mover by Local Space offsets over time, using separate interpolation modes.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset from the final queued target transform.
rotationOffsetSansar.QuaternionThe local space rotation offset from the final queued target transform.
timeInSecondsdoubleThe shared duration in seconds for translation and rotation.
translationModeMoveModeThe interpolation mode applied to translation only.
rotationModeMoveModeThe interpolation mode applied to rotation only.
Remarks

This asynchronous method queues one combined move command then returns. Translation is applied in local space before the rotation offset, relative to the final queued target transform. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddMoveOffset(     Sansar.Vector positionOffset,     Sansar.Quaternion rotationOffset,     double timeInSeconds,     MoveMode interpolationMode,     Action<Sansar.Script.OperationCompleteEvent> handler )

Translate and rotate the Mover to the target Local Space position and rotation over time.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset.
rotationOffsetSansar.QuaternionThe local space rotation offset.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

New in 47.10.0
public void AddMoveOffset(     Sansar.Vector positionOffset,     Sansar.Quaternion rotationOffset,     double timeInSeconds,     MoveMode translationMode,     MoveMode rotationMode,     Action<Sansar.Script.OperationCompleteEvent> handler )

Translate and rotate the Mover by Local Space offsets over time, using separate interpolation modes.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset from the final queued target transform.
rotationOffsetSansar.QuaternionThe local space rotation offset from the final queued target transform.
timeInSecondsdoubleThe shared duration in seconds for translation and rotation.
translationModeMoveModeThe interpolation mode applied to translation only.
rotationModeMoveModeThe interpolation mode applied to rotation only.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues one combined move command then returns. Translation is applied in local space before the rotation offset, relative to the final queued target transform. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to ScriptBase.WaitFor while in a coroutine.

AddPause

Added in 32.0.0
public void AddPause(double timeInSeconds)

Adds a pause of the given length for this Mover.

ParameterTypeDescription
timeInSecondsdoubleThe amount of time in seconds that the movement should be paused.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddPause(     double timeInSeconds,     Action<Sansar.Script.OperationCompleteEvent> handler )

Adds a pause of the given length for this Mover.

ParameterTypeDescription
timeInSecondsdoubleThe amount of time in seconds that the movement should be paused.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

AddRotate

Added in 32.0.0
public void AddRotate(Sansar.Quaternion rotation)

Sets the rotation of this Mover to a target World Space rotation.

ParameterTypeDescription
rotationSansar.QuaternionThe target rotation.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddRotate(     Sansar.Quaternion rotation,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sets the rotation of this Mover to a target World Space rotation.

ParameterTypeDescription
rotationSansar.QuaternionThe target rotation.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddRotate(     Sansar.Quaternion targetRotation,     double timeInSeconds,     MoveMode interpolationMode )

Rotate the Mover to the target World Space rotation over time.

ParameterTypeDescription
targetRotationSansar.QuaternionThe target rotation.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddRotate(     Sansar.Quaternion targetRotation,     double timeInSeconds,     MoveMode interpolationMode,     Action<Sansar.Script.OperationCompleteEvent> handler )

Rotate the Mover to the target World Space rotation over time.

ParameterTypeDescription
targetRotationSansar.QuaternionThe target rotation.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

AddRotateOffset

Added in 33.2.0
public void AddRotateOffset(Sansar.Quaternion rotationOffset)

Sets the rotation of this Mover to a target Local Space rotation.

ParameterTypeDescription
rotationOffsetSansar.QuaternionThe local space rotation offset.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddRotateOffset(     Sansar.Quaternion rotationOffset,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sets the rotation of this Mover to a target Local Space rotation.

ParameterTypeDescription
rotationOffsetSansar.QuaternionThe local space rotation offset.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddRotateOffset(     Sansar.Quaternion rotationOffset,     double timeInSeconds,     MoveMode interpolationMode )

Rotate the Mover to the target Local Space rotation over time.

ParameterTypeDescription
rotationOffsetSansar.QuaternionThe local space rotation offset.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddRotateOffset(     Sansar.Quaternion rotationOffset,     double timeInSeconds,     MoveMode interpolationMode,     Action<Sansar.Script.OperationCompleteEvent> handler )

Rotate the Mover to the target Local Space rotation over time.

ParameterTypeDescription
rotationOffsetSansar.QuaternionThe local space rotation offset.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

AddTranslate

Added in 32.0.0
public void AddTranslate(Sansar.Vector position)

Sets the position of this Mover to a target World Space position.

ParameterTypeDescription
positionSansar.VectorThe target position.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddTranslate(     Sansar.Vector position,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sets the position of this Mover to a target World Space position.

ParameterTypeDescription
positionSansar.VectorThe target position.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddTranslate(     Sansar.Vector targetPosition,     double timeInSeconds,     MoveMode interpolationMode )

Translate the Mover to the target World Space position over time.

ParameterTypeDescription
targetPositionSansar.VectorThe target position.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void AddTranslate(     Sansar.Vector targetPosition,     double timeInSeconds,     MoveMode interpolationMode,     Action<Sansar.Script.OperationCompleteEvent> handler )

Translate the Mover to the target World Space position over time.

ParameterTypeDescription
targetPositionSansar.VectorThe target position.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

AddTranslateOffset

Added in 33.2.0
public void AddTranslateOffset(Sansar.Vector positionOffset)

Sets the position of this Mover to a target Local Space position.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddTranslateOffset(     Sansar.Vector positionOffset,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sets the position of this Mover to a target Local Space position.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddTranslateOffset(     Sansar.Vector positionOffset,     double timeInSeconds,     MoveMode interpolationMode )

Translate the Mover to the target Local Space position over time.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 33.2.0
public void AddTranslateOffset(     Sansar.Vector positionOffset,     double timeInSeconds,     MoveMode interpolationMode,     Action<Sansar.Script.OperationCompleteEvent> handler )

Translate the Mover to the target Local Space position over time.

ParameterTypeDescription
positionOffsetSansar.VectorThe local space position offset.
timeInSecondsdoubleThe time in seconds to move over.
interpolationModeMoveModeThe method of interpolation to use when moving.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.

StopAndClear

Added in 32.0.0
public void StopAndClear()

Stops the current movement and clears any further movements for this Mover.

Remarks

This method is not enqueued like other operations on the Mover. To block until the operation has executed, pass this method to ScriptBase.WaitFor while in a coroutine.

Added in 32.0.0
public void StopAndClear(     Action<Sansar.Script.OperationCompleteEvent> handler )

Stops the current movement and clears any further movements for this Mover.

ParameterTypeDescription
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

This method is not enqueued like other operations on the Mover. To block until the operation has executed, pass this method to ScriptBase.WaitFor while in a coroutine.

ToString

Added in 32.0.0
public override string ToString()

A string representation of this object.

Returns: string — A string representation of this object.

Remarks

The format of this string may change between releases.

Used in examples

Generated from the Sansar 47.10.0 client ScriptApi snapshot.