Skip to content
IntegratedMover

Gameplay / IntegratedMover

IntegratedMover Class

Motor components

Example usage: Create a script called "IMEample1", place it in the object bar, open the script, enter the following code to save, run the game, and you will see two rectangular prisms in the scene, repeating linear motion with and without smooth motion. The code is as follows:

ts
@Component
export default class IMExample1 extends Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
      if (SystemUtil.isClient()) {
          // Create a box
          this.Obj1 = await GameObject.asyncSpawn("197386") as GameObject;
          // Set starting position
          this.Obj1.worldTransform.position = new Vector(300.0, -100.0, 300.0);
          // Set Start scale
          this.Obj1.worldTransform.scale = new Vector(0.5, 2.0, 0.5);

          // Create a Integrated Mover and mount the Integrated Mover onto the box
          this.IM1 = await GameObject.asyncSpawn("PhysicsSports") as IntegratedMover;
          this.IM1.attachToGameObject(this.Obj1);

          // Test enabled status
          console.log("Enable status: " + this.IM1.enable);
          this.IM1.enable = true;
          console.log("New enable status: " + this.IM1.enable);

          // Add a linear motion
          this.IM1.linearSpeed = new Vector(0.0, 100.0, 0.0);
          this.IM1.linearRepeat = true;
          this.IM1.linearRepeatTime = 2.0;
          this.IM1.linearRepeatDelay = 0.0;
          this.IM1.linearReturnDelay = 0.0;

          // Create the second box and the second Integrated Mover in the same way
          this.Obj2 = await GameObject.asyncSpawn("197386") as GameObject;
          this.Obj2.worldTransform.position = new Vector(300.0, -100.0, 150.0);
          this.Obj2.worldTransform.scale = new Vector(0.5, 2.0, 0.5);
          this.IM2 = await GameObject.asyncSpawn("PhysicsSports") as IntegratedMover;
          this.IM2.attachToGameObject(this.Obj2);
          this.IM2.enable = true;

          // Turn on smooth motion for the second Integrated Mover
          console.log("Smooth status: " + this.IM2.smooth);
          this.IM2.smooth = true;
          console.log("New smooth status: " + this.IM2.smooth);

          // Add an identical linear motion
          this.IM2.linearSpeed = new Vector(0.0, 100.0, 0.0);
          this.IM2.linearRepeat = true;
          this.IM2.linearRepeatTime = 2.0;
          this.IM2.linearRepeatDelay = 0.0;
          this.IM2.linearReturnDelay = 0.0;
      }
  }
}
@Component
export default class IMExample1 extends Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
      if (SystemUtil.isClient()) {
          // Create a box
          this.Obj1 = await GameObject.asyncSpawn("197386") as GameObject;
          // Set starting position
          this.Obj1.worldTransform.position = new Vector(300.0, -100.0, 300.0);
          // Set Start scale
          this.Obj1.worldTransform.scale = new Vector(0.5, 2.0, 0.5);

          // Create a Integrated Mover and mount the Integrated Mover onto the box
          this.IM1 = await GameObject.asyncSpawn("PhysicsSports") as IntegratedMover;
          this.IM1.attachToGameObject(this.Obj1);

          // Test enabled status
          console.log("Enable status: " + this.IM1.enable);
          this.IM1.enable = true;
          console.log("New enable status: " + this.IM1.enable);

          // Add a linear motion
          this.IM1.linearSpeed = new Vector(0.0, 100.0, 0.0);
          this.IM1.linearRepeat = true;
          this.IM1.linearRepeatTime = 2.0;
          this.IM1.linearRepeatDelay = 0.0;
          this.IM1.linearReturnDelay = 0.0;

          // Create the second box and the second Integrated Mover in the same way
          this.Obj2 = await GameObject.asyncSpawn("197386") as GameObject;
          this.Obj2.worldTransform.position = new Vector(300.0, -100.0, 150.0);
          this.Obj2.worldTransform.scale = new Vector(0.5, 2.0, 0.5);
          this.IM2 = await GameObject.asyncSpawn("PhysicsSports") as IntegratedMover;
          this.IM2.attachToGameObject(this.Obj2);
          this.IM2.enable = true;

          // Turn on smooth motion for the second Integrated Mover
          console.log("Smooth status: " + this.IM2.smooth);
          this.IM2.smooth = true;
          console.log("New smooth status: " + this.IM2.smooth);

          // Add an identical linear motion
          this.IM2.linearSpeed = new Vector(0.0, 100.0, 0.0);
          this.IM2.linearRepeat = true;
          this.IM2.linearRepeatTime = 2.0;
          this.IM2.linearRepeatDelay = 0.0;
          this.IM2.linearReturnDelay = 0.0;
      }
  }
}

Hierarchy

Table of contents

Properties

onLinearEnable: MulticastDelegate<() => void>
The first time the translational motion is delayed to start, the callback event cannot be obtained because it is not enable when the delay start time is 0
onLinearReturn: MulticastDelegate<() => void>
When the translational movement reaches the end point, it will be recalled. When the pause time after repeat delay is 0, it will not be enable, and callback events cannot be obtained
onLinearStart: MulticastDelegate<() => void>
When the translational motion returns to the starting point and pauses, it will callback. When the pause time is 0 after returning, it will not be enabled and cannot obtain callback events
onRotationEnable: MulticastDelegate<() => void>
The rotation movement is called back when it is delayed to start for the first time. When the delay start time is 0, it indicates that it is not enable, and the callback event cannot be obtained
onRotationReturn: MulticastDelegate<() => void>
When the rotational motion reaches the endpoint and pauses, it will callback. When the pause time is 0, it will not be enabled and cannot obtain callback events
onRotationStart: MulticastDelegate<() => void>
When the rotation motion returns to the starting point and pauses, it will callback. When the pause time is 0 after returning, it will not be enabled and cannot obtain callback events
onScaleEnable: MulticastDelegate<() => void>
When the scaling motion is delayed for the first time, it will callback. When the delay start time is 0, it will not be enabled and cannot obtain callback events
onScaleReturn: MulticastDelegate<() => void>
When the scale movement reaches the end point, it will be recalled. When the repeat delay is 0, it will not be enable, and callback events cannot be obtained
onScaleStart: MulticastDelegate<() => void>
When the scaling motion returns to the starting point and pauses, it will be called back. When the pause time is 0 after returning, it will not be enabled and cannot obtain callback events
onSwingEnable: MulticastDelegate<() => void>
Swing: Delayed start callback
click

Properties

onBeforeDestroyDelegate: MulticastDelegate<() => void> other
Event callback before object destruction
onCustomPropertyChange: Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Monitor custom attribute synchronization events
onDestroyDelegate: MulticastDelegate<() => void> other
Event callback after object destruction
onPropertyChange: Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>>
Monitor system replicated events

Accessors

enable(): boolean other
Get enabled status
linearDelayStartTime(): number other
Obtain the delay start translation running time
linearRepeat(): boolean other
Obtain the status of translational repetitive motion
linearRepeatDelay(): number other
Obtain the pause time after the translation arrives
linearRepeatTime(): number other
Obtain the translation repeat time
linearReturnDelay(): number other
Obtain the pause time after the translation return trip
linearSpeed(): Vector other
Obtain the magnitude of translation speed
motionCoordinate(): MotionAxis other
Obtain the motion coordinate system
motionMode(): MotionMode other
Get sports mode
rotationDelayStartTime(): number other
Obtain the delay start rotation running time
rotationRepeat(): boolean other
Obtain the rotational repetitive motion state
rotationRepeatDelay(): number other
Obtain the pause time after the rotation arrives
rotationRepeatTime(): number other
Obtain the one-way rotation motion time
rotationReturnDelay(): number other
Obtain the pause time after the rotation return delay
rotationSpeed(): Vector other
Obtain the rotational speed magnitude
scaleDelayStartTime(): number other
Get delayed startup scaling runtime
scaleRepeat(): boolean other
Get scale Repeat Motion Status
scaleRepeatDelay(): number other
Get the pause time after zooming in and out
scaleRepeatTime(): number other
Obtain the zoom one-way motion time
scaleReturnDelay(): number other
Obtain the pause time after scaling the return trip
scaleSpeed(): Vector other
Get scale speed
smooth(): boolean other
Obtain smooth state
swingAngle(): number other
Obtain the maximum swing angle
swingDelayStartTime(): number other
Obtain the delay start swing running time
swingSpeed(): Vector other
Obtain the speed of swinging motion
click

Accessors

actorFlagValue(): number other
Get object tags
actorLevel(): number other
Obtain Actor Level
assetId(): string other
Retrieve the UID of the resource currently being used by the object
gameObjectId(): string other
Get the unique identification of an object (a string that uniquely identifies an object).
isDestroyed(): boolean other
Has the current object been destroyed
isReady(): boolean other
Current object status
localTransform(): Transform other
Local transformation of the current object
name(): string other
Return the current object name
netStatus(): NetStatus other
Get the current object synchronization status
parent(): GameObject other
Retrieve the current parent object
tag(): string other
Get the tag of the current object
worldTransform(): Transform other
Current object world transformation

Methods

moverReset(OnReset?: () => void): void other
Reset the state of the motion device and return the moving object to its initial position simultaneously
click

Methods

addComponent<T: extends Script<T>>(constructor: (...args: unknown[]) => T: extends Script<T>, bInReplicates?: boolean): T: extends Script<T> other
Add a script component
asyncGetChildByName(name: string): Promise<GameObject> other
Asynchronous search for sub objects based on their names
asyncReady(): Promise<GameObject> other
Return after the object is ready
clone(gameObjectInfo?: GameObjectInfo): GameObject other
Copy Objects
destroy(): void other
delete object
getBoundingBox(nonColliding?: boolean, includeFromChild?: boolean, outer?: Vector): Vector other
Get the size of the object's bounding box
getBounds(onlyCollidingComponents: boolean, originOuter: Vector, boxExtentOuter: Vector, includeFromChild?: boolean): void other
Obtain object boundaries
getChildByGameObjectId(gameObjectId: string): GameObject other
Search for sub objects based on gameObjectid
getChildByName(name: string): GameObject other
Search for sub objects by name
getChildByPath(path: string): GameObject other
Find sub objects according to path
getChildren(): GameObject[] other
Obtain sub objects
getChildrenBoundingBoxCenter(outer?: Vector): Vector other
Get the center point of all child objects' bounding box (not including the parent object, if the parent object is unavailable, return [0,0,0])
getChildrenByName(name: string): GameObject[] other
Search for all sub objects by name
getComponent<T: extends Script<T>>(constructor?: (...args: unknown[]) => T: extends Script<T>): T: extends Script<T> other
Get the component of the specified type
getComponentPropertys<T: extends Script<T>>(constructor: (...args: unknown[]) => T: extends Script<T>): Map<string, IPropertyOptions> other
Get property of script component
getComponents<T: extends Script<T>>(constructor?: (...args: unknown[]) => T: extends Script<T>): T: extends Script<T>[] other
Get all component of the specified type
getCustomProperties(): string[] other
Get all customize property
getCustomProperty<T: extends CustomPropertyType>(propertyName: string): T: extends CustomPropertyType other
Get customize property
getCustomPropertyChangeDelegate(property): Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Event proxy triggered when a given object property is modified
getPropertyChangeDelegate(property): Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Event proxy triggered when a given object property is modified
getVisibility(): boolean other
Obtain whether the object is displayed
isPrefabActor(): boolean other
Return whether the current object is a prefabricated body
moveBy(velocity: Vector, isLocal?: boolean): void other
Smoothly move an object over time according to a given velocity vector
moveTo(targetPosition: Vector, time: number, isLocal?: boolean, onComplete?: () => void): void other
Smoothly move from the current position to the target position within the specified time
rotateBy(rotation: Quaternion Rotation, multiplier: number, isLocal?: boolean): void other
Rotate the object smoothly over time according to the given rotation amount
rotateTo(targetRotation: Quaternion Rotation, time: number, isLocal?: boolean, onComplete?: () => void): void other
Smoothly changes from the current rotation to the target rotation within the specified time
scaleBy(scale: Vector, isLocal?: boolean): void other
Smoothly scale objects over time using a given scaling vector per second
scaleTo(targetScale: Vector, time: number, isLocal?: boolean, onComplete?: () => void): void other
Smoothly changes from the current scale to the target scale within the specified time
setAbsolute(absolutePosition?: boolean, absoluteRotation?: boolean, absoluteScale?: boolean): void other
Set whether the object localTransform is relative to the parent object or the world
setCustomProperty(propertyName: string, value: undefined CustomPropertyType): void other
Set custom attributes
setVisibility(status: boolean PropertyStatus, propagateToChildren?: boolean): void other
Set whether the object is displayed
stopMove(): void other
Interrupt further movement of moveTo() and moveBy()
stopRotate(): void other
Interrupt further rotation from rotateTo() or rotateBy()
stopScale(): void other
Interrupt further scale from ScaleTo() or ScaleBy()
asyncFindGameObjectById(gameObjectId: string): Promise<GameObject> other
Asynchronous search for GameObject through gameObjectid
asyncGetGameObjectByPath(path: string): Promise<GameObject> other
Asynchronously find objects through path
asyncSpawn<T: extends GameObject<T>>(assetId: string, gameObjectInfo?: GameObjectInfo): Promise<T: extends GameObject<T>> other
Asynchronous construction of an object
bulkPivotTo(gameObjects: GameObject[], transforms: Transform[]): void other
Batch set position
findGameObjectById(gameObjectId: string): GameObject other
Search for objects through gameObjectid
findGameObjectByName(name: string): GameObject other
Search for objects by name
findGameObjectsByName(name: string): GameObject[] other
Search for objects by name
findGameObjectsByTag(tag: string): GameObject[] other
Get objects through customize tag
getGameObjectByPath(path: string): GameObject other
Search for objects through paths
spawn<T: extends GameObject<T>>(assetId: string, gameObjectInfo?: GameObjectInfo): T: extends GameObject<T> other
Construct an object

Properties


onLinearEnable

onLinearEnable: MulticastDelegate<() => void>

The first time the translational motion is delayed to start, the callback event cannot be obtained because it is not enable when the delay start time is 0


onLinearReturn

onLinearReturn: MulticastDelegate<() => void>

When the translational movement reaches the end point, it will be recalled. When the pause time after repeat delay is 0, it will not be enable, and callback events cannot be obtained


onLinearStart

onLinearStart: MulticastDelegate<() => void>

When the translational motion returns to the starting point and pauses, it will callback. When the pause time is 0 after returning, it will not be enabled and cannot obtain callback events


onRotationEnable

onRotationEnable: MulticastDelegate<() => void>

The rotation movement is called back when it is delayed to start for the first time. When the delay start time is 0, it indicates that it is not enable, and the callback event cannot be obtained


onRotationReturn

onRotationReturn: MulticastDelegate<() => void>

When the rotational motion reaches the endpoint and pauses, it will callback. When the pause time is 0, it will not be enabled and cannot obtain callback events


onRotationStart

onRotationStart: MulticastDelegate<() => void>

When the rotation motion returns to the starting point and pauses, it will callback. When the pause time is 0 after returning, it will not be enabled and cannot obtain callback events


onScaleEnable

onScaleEnable: MulticastDelegate<() => void>

When the scaling motion is delayed for the first time, it will callback. When the delay start time is 0, it will not be enabled and cannot obtain callback events


onScaleReturn

onScaleReturn: MulticastDelegate<() => void>

When the scale movement reaches the end point, it will be recalled. When the repeat delay is 0, it will not be enable, and callback events cannot be obtained


onScaleStart

onScaleStart: MulticastDelegate<() => void>

When the scaling motion returns to the starting point and pauses, it will be called back. When the pause time is 0 after returning, it will not be enabled and cannot obtain callback events


onSwingEnable

onSwingEnable: MulticastDelegate<() => void>

Swing: Delayed start callback

Accessors


enable

get enable(): boolean other

set enable(newEnable): void other

Get enabled status

Returns

booleanEnable Status

Set Enable Status

Parameters

newEnable booleanUsage: enabled status

linearDelayStartTime

get linearDelayStartTime(): number other

set linearDelayStartTime(newDelay): void other

Obtain the delay start translation running time

Returns

numberDelay start time

Set the delay to start the translational motion time

Parameters

newDelay numberUsage: delay start time

linearRepeat

get linearRepeat(): boolean other

set linearRepeat(newRepeat): void other

Obtain the status of translational repetitive motion

Returns

booleanTranslational repetitive motion state

Set translational repetitive motion state

Parameters

newRepeat booleanUsage: Translating and repeating motion state

linearRepeatDelay

get linearRepeatDelay(): number other

set linearRepeatDelay(newDelay): void other

Obtain the pause time after the translation arrives

Returns

numberPause time after reaching translation

Set the repeat delay after arrival of the translation. This property will take effect only when the repetitive motion status is true

Parameters

newDelay numberUsage: translation repeat delay

linearRepeatTime

get linearRepeatTime(): number other

set linearRepeatTime(newTime): void other

Obtain the translation repeat time

Returns

numberTranslation repeat time

Set the translation repeat time. This property will take effect only when the repeated motion status is true

Parameters

newTime numberUsage: translation repeat time

linearReturnDelay

get linearReturnDelay(): number other

set linearReturnDelay(newDelay): void other

Obtain the pause time after the translation return trip

Returns

numberPause time after translation return delay

Set the pause time after the translation return delay. This property will take effect only when the repetitive movement status is true

Parameters

newDelaynumber

Pause time after translation return delay


linearSpeed

get linearSpeed(): Vector other

set linearSpeed(newSpeed): void other

Obtain the magnitude of translation speed

Usage example: create a script named "IMExample2", place it in the object bar, open the script, enter the following code to save it, run the game, and you will see two boxes in the scene, demonstrating whether there is a non repeated linear motion that is delayed to start, and whether there is a repeated linear motion that is stopped at the start and end. The code is as follows:

ts
@Component
export default class IMExample2 extends Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if (SystemUtil.isClient()) {
            // Create Box 1 and Box 2
            this.Obj1 = await GameObject.asyncSpawn( "197386") as GameObject;
            this.Obj2 = await GameObject.asyncSpawn("197386") as GameObject;
            // Set starting position
            this.Obj1.worldTransform.position = new Vector(300.0, 0.0, 300.0);
            this.Obj2.worldTransform.position = new Vector(300.0, 0.0, 150.0);
            // Set Start scale
            this.Obj1.worldTransform.scale = new Vector(0.5, 2.0, 0.5);
            this.Obj2.worldTransform.scale = new Vector(0.5, 2.0, 0.5);

            // Create Mover 1 and Mover 2, and mount them onto the corresponding rectangular prism
            this.IM1 = await GameObject.asyncSpawn("PhysicsSports") as IntegratedMover;
            this.IM1.attachToGameObject(this.Obj1);
            this.IM1.enable = true;

            this.IM2 = await GameObject.asyncSpawn("PhysicsSports") as IntegratedMover;
            this.IM2.attachToGameObject(this.Obj2);
            this.IM2.enable = true;

            // Integrated Mover 1 and 2 both set the same movement speed, and Integrated Mover 2 set a delay of five seconds to start
            this.IM1.linearSpeed = new Vector(0.0, 100.0, 0.0);
            this.IM1.linearRepeat = false;
            this.IM1.linearDelayStartTime = 0.0;

            this.IM2.linearSpeed = new Vector(0.0, 100.0, 0.0);
            this.IM2.linearRepeat = false;
            this.IM2.linearDelayStartTime = 5.0;
            // Integrated Mover 2 binding delay start callback
            this.IM2.onLinearEnable.add(() => {
                console.log("IM2 enabled with a delay");
            })

            // After waiting for ten seconds, return the box 1 and 2, reset the Integrated Mover 1 and 2, and let them become the repeated motion mode, and set a two second delay at the start and end of the Integrated Mover 2
            setTimeout(() => {
                this.IM1.moverReset();
                this.IM2.moverReset();

                this.IM1.linearRepeat = true;
                this.IM1.linearRepeatTime = 2.0;
                this.IM1.linearDelayStartTime = 0.0;
                this.IM1.linearRepeatDelay = 0.0;
                this.IM1.linearReturnDelay = 0.0;

                this.IM2.linearRepeat = true;
                this.IM2.linearRepeatTime = 2.0;
                this.IM2.linearDelayStartTime = 0.0;
                this.IM2.linearRepeatDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onLinearReturn.add(() => {
                    console.log("IM2 paused at end point");
                })
                this.IM2.linearReturnDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onLinearStart.add(() => {
                    console.log("IM2 paused at start point");
                })
            }, 10000);
        }
    }

    //
    // Periodic function executed per frame
    // This function requires assigning the value 'this.useUpdate' to 'true' for execution
    // @param dt Delay between current frame and previous frame in seconds
    protected onUpdate(dt: number): void {

    }

    // Call this function after the last frame is executed when the script is destroyed
    protected onDestroy(): void {

    }
}
@Component
export default class IMExample2 extends Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if (SystemUtil.isClient()) {
            // Create Box 1 and Box 2
            this.Obj1 = await GameObject.asyncSpawn( "197386") as GameObject;
            this.Obj2 = await GameObject.asyncSpawn("197386") as GameObject;
            // Set starting position
            this.Obj1.worldTransform.position = new Vector(300.0, 0.0, 300.0);
            this.Obj2.worldTransform.position = new Vector(300.0, 0.0, 150.0);
            // Set Start scale
            this.Obj1.worldTransform.scale = new Vector(0.5, 2.0, 0.5);
            this.Obj2.worldTransform.scale = new Vector(0.5, 2.0, 0.5);

            // Create Mover 1 and Mover 2, and mount them onto the corresponding rectangular prism
            this.IM1 = await GameObject.asyncSpawn("PhysicsSports") as IntegratedMover;
            this.IM1.attachToGameObject(this.Obj1);
            this.IM1.enable = true;

            this.IM2 = await GameObject.asyncSpawn("PhysicsSports") as IntegratedMover;
            this.IM2.attachToGameObject(this.Obj2);
            this.IM2.enable = true;

            // Integrated Mover 1 and 2 both set the same movement speed, and Integrated Mover 2 set a delay of five seconds to start
            this.IM1.linearSpeed = new Vector(0.0, 100.0, 0.0);
            this.IM1.linearRepeat = false;
            this.IM1.linearDelayStartTime = 0.0;

            this.IM2.linearSpeed = new Vector(0.0, 100.0, 0.0);
            this.IM2.linearRepeat = false;
            this.IM2.linearDelayStartTime = 5.0;
            // Integrated Mover 2 binding delay start callback
            this.IM2.onLinearEnable.add(() => {
                console.log("IM2 enabled with a delay");
            })

            // After waiting for ten seconds, return the box 1 and 2, reset the Integrated Mover 1 and 2, and let them become the repeated motion mode, and set a two second delay at the start and end of the Integrated Mover 2
            setTimeout(() => {
                this.IM1.moverReset();
                this.IM2.moverReset();

                this.IM1.linearRepeat = true;
                this.IM1.linearRepeatTime = 2.0;
                this.IM1.linearDelayStartTime = 0.0;
                this.IM1.linearRepeatDelay = 0.0;
                this.IM1.linearReturnDelay = 0.0;

                this.IM2.linearRepeat = true;
                this.IM2.linearRepeatTime = 2.0;
                this.IM2.linearDelayStartTime = 0.0;
                this.IM2.linearRepeatDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onLinearReturn.add(() => {
                    console.log("IM2 paused at end point");
                })
                this.IM2.linearReturnDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onLinearStart.add(() => {
                    console.log("IM2 paused at start point");
                })
            }, 10000);
        }
    }

    //
    // Periodic function executed per frame
    // This function requires assigning the value 'this.useUpdate' to 'true' for execution
    // @param dt Delay between current frame and previous frame in seconds
    protected onUpdate(dt: number): void {

    }

    // Call this function after the last frame is executed when the script is destroyed
    protected onDestroy(): void {

    }
}

Returns

VectorTranslation speed magnitude

Set the translation speed size

Parameters

newSpeed VectorUsage: Size of translation speed

motionCoordinate

get motionCoordinate(): MotionAxis other

set motionCoordinate(newMotionCoordinate): void other

Obtain the motion coordinate system

Returns

MotionAxisMotion coordinate system

Set motion coordinate system

Parameters

newMotionCoordinate MotionAxisUsage: Motion coordinate system

motionMode

get motionMode(): MotionMode other

set motionMode(mode): void other

Get sports mode

Returns

MotionModeMotor motion mode

Set sports mode

Parameters

mode MotionModeUsage: Integrated Mover movement mode

rotationDelayStartTime

get rotationDelayStartTime(): number other

set rotationDelayStartTime(newDelay): void other

Obtain the delay start rotation running time

Returns

numberDelay start time

Set delay start rotation motion time

Parameters

newDelay numberUsage: delay start time

rotationRepeat

get rotationRepeat(): boolean other

set rotationRepeat(newRepeat): void other

Obtain the rotational repetitive motion state

Returns

booleanRotating repetitive motion state

Set the rotational repetitive motion state

Parameters

newRepeat booleanUsage: Rotation Repetitive Motion State

rotationRepeatDelay

get rotationRepeatDelay(): number other

set rotationRepeatDelay(newDelay): void other

Obtain the pause time after the rotation arrives

Returns

numberRotation repeat delay after arrival

Set repeat delay after arrival of rotation

This attribute will only take effect when the repeated motion state is true

Parameters

newDelay numberRotation repeat delay range: (0,+∞) type: floating point

rotationRepeatTime

get rotationRepeatTime(): number other

set rotationRepeatTime(newTime): void other

Obtain the one-way rotation motion time

Returns

numberRotation repeat time

Set the rotation repeat time

This property takes effect only when the repeated motion state is true.

Parameters

newTime numberRotate repeat time. Range: (0,+∞) type: Floating point number

rotationReturnDelay

get rotationReturnDelay(): number other

set rotationReturnDelay(newDelay): void other

Obtain the pause time after the rotation return delay

Returns

numberPause time after returning

Set the pause time after the rotation return delay. This property will take effect only when the repeated movement status is true

Parameters

newDelay numberUsage: Pause time after return range: (0,+∞) type: Floating point number

rotationSpeed

get rotationSpeed(): Vector other

set rotationSpeed(newSpeed): void other

Obtain the rotational speed magnitude

Usage example: create a script named "IMExample3", place it in the object bar, open the script, enter the following code to save it, run the game, and you will see two boxes in the scene, demonstrating whether there is non repeated rotation that is delayed to start, and whether there is repeated rotation that is stopped at the start and end. The code is as follows:

ts
@Component
export default class IMExample3 extends mw.Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if (Util.SystemUtil.isClient()) {
            // Create Box 1 and Box 2
            this.Obj1 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            this.Obj2 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            // Set starting position
            this.Obj1.worldTransform.position = new mw.Vector(300.0, 200.0, 200.0);
            this.Obj2.worldTransform.position = new mw.Vector(300.0, -200.0, 200.0);
            // Set Start scale
            this.Obj1.worldTransform.scale = new mw.Vector(0.5, 2.0, 0.5);
            this.Obj2.worldTransform.scale = new mw.Vector(0.5, 2.0, 0.5);

            // Create Mover 1 and Mover 2, and mount them onto the corresponding rectangular prism
            this.IM1 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM1.attachToGameObject(this.Obj1);
            this.IM1.enable = true;

            this.IM2 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM2.attachToGameObject(this.Obj2);
            this.IM2.enable = true;

            // Both motor 1 and motor 2 are set to the same rotational speed, and motor 2 is set to start with a delay of five seconds
            this.IM1.rotationSpeed = new mw.Vector(90.0, 0.0, 0.0);
            this.IM1.rotationRepeat = false;
            this.IM1.rotationDelayStartTime = 0.0;

            this.IM2.rotationSpeed = new mw.Vector(90.0, 0.0, 0.0);
            this.IM2.rotationRepeat = false;
            this.IM2.rotationDelayStartTime = 5.0;
            // Integrated Mover 2 binding delay start callback
            this.IM2.onRotationEnable.add(() => {
                console.log("IM2 enabled with a delay");
            })

            // After waiting for ten seconds, return the box 1 and 2, reset the Integrated Mover 1 and 2, and let them become the repeated motion mode, and set a two second delay at the start and end of the Integrated Mover 2
            setTimeout(() => {
                this.IM1.moverReset();
                this.IM2.moverReset();

                this.IM1.rotationRepeat = true;
                this.IM1.rotationRepeatTime = 2.0;
                this.IM1.rotationDelayStartTime = 0.0;
                this.IM1.rotationRepeatDelay = 0.0;
                this.IM1.rotationReturnDelay = 0.0;

                this.IM2.rotationRepeat = true;
                this.IM2.rotationRepeatTime = 2.0;
                this.IM2.rotationDelayStartTime = 0.0;
                this.IM2.rotationRepeatDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onRotationReturn.add(() => {
                    console.log("IM2 paused at end point");
                })
                this.IM2.rotationReturnDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onRotationStart.add(() => {
                    console.log("IM2 paused at start point");
                })
            }, 10000);
        }
    }

    //
    // Periodic function executed per frame
    // This function requires assigning the value 'this.useUpdate' to 'true' for execution
    // @param dt Delay between current frame and previous frame in seconds
    protected onUpdate(dt: number): void {

    }

    // Call this function after the last frame is executed when the script is destroyed
    protected onDestroy(): void {

    }
}
@Component
export default class IMExample3 extends mw.Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if (Util.SystemUtil.isClient()) {
            // Create Box 1 and Box 2
            this.Obj1 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            this.Obj2 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            // Set starting position
            this.Obj1.worldTransform.position = new mw.Vector(300.0, 200.0, 200.0);
            this.Obj2.worldTransform.position = new mw.Vector(300.0, -200.0, 200.0);
            // Set Start scale
            this.Obj1.worldTransform.scale = new mw.Vector(0.5, 2.0, 0.5);
            this.Obj2.worldTransform.scale = new mw.Vector(0.5, 2.0, 0.5);

            // Create Mover 1 and Mover 2, and mount them onto the corresponding rectangular prism
            this.IM1 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM1.attachToGameObject(this.Obj1);
            this.IM1.enable = true;

            this.IM2 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM2.attachToGameObject(this.Obj2);
            this.IM2.enable = true;

            // Both motor 1 and motor 2 are set to the same rotational speed, and motor 2 is set to start with a delay of five seconds
            this.IM1.rotationSpeed = new mw.Vector(90.0, 0.0, 0.0);
            this.IM1.rotationRepeat = false;
            this.IM1.rotationDelayStartTime = 0.0;

            this.IM2.rotationSpeed = new mw.Vector(90.0, 0.0, 0.0);
            this.IM2.rotationRepeat = false;
            this.IM2.rotationDelayStartTime = 5.0;
            // Integrated Mover 2 binding delay start callback
            this.IM2.onRotationEnable.add(() => {
                console.log("IM2 enabled with a delay");
            })

            // After waiting for ten seconds, return the box 1 and 2, reset the Integrated Mover 1 and 2, and let them become the repeated motion mode, and set a two second delay at the start and end of the Integrated Mover 2
            setTimeout(() => {
                this.IM1.moverReset();
                this.IM2.moverReset();

                this.IM1.rotationRepeat = true;
                this.IM1.rotationRepeatTime = 2.0;
                this.IM1.rotationDelayStartTime = 0.0;
                this.IM1.rotationRepeatDelay = 0.0;
                this.IM1.rotationReturnDelay = 0.0;

                this.IM2.rotationRepeat = true;
                this.IM2.rotationRepeatTime = 2.0;
                this.IM2.rotationDelayStartTime = 0.0;
                this.IM2.rotationRepeatDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onRotationReturn.add(() => {
                    console.log("IM2 paused at end point");
                })
                this.IM2.rotationReturnDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onRotationStart.add(() => {
                    console.log("IM2 paused at start point");
                })
            }, 10000);
        }
    }

    //
    // Periodic function executed per frame
    // This function requires assigning the value 'this.useUpdate' to 'true' for execution
    // @param dt Delay between current frame and previous frame in seconds
    protected onUpdate(dt: number): void {

    }

    // Call this function after the last frame is executed when the script is destroyed
    protected onDestroy(): void {

    }
}

Returns

VectorRotation speed size

Set the rotation speed size

Parameters

newSpeed VectorUsage: Rotation speed size

scaleDelayStartTime

get scaleDelayStartTime(): number other

set scaleDelayStartTime(newDelay): void other

Get delayed startup scaling runtime

Returns

numberDelay start time

Set delay to start scaling motion time

Parameters

newDelay numberUsage: Delay startup time range: (0,+∞) type: Floating point number

scaleRepeat

get scaleRepeat(): boolean other

set scaleRepeat(newRepeat): void other

Get scale Repeat Motion Status

Returns

booleanRepetitive motion state

Set zoom repeat motion state

Parameters

newRepeat booleanUsage: Repetitive motion state

scaleRepeatDelay

get scaleRepeatDelay(): number other

set scaleRepeatDelay(newDelay): void other

Get the pause time after zooming in and out

Returns

numberRepeat delay

Set the scale repeat delay after arrival. This property will take effect only when the repeated motion state is true

Parameters

newDelay numberUsage: repeat delay range: (0,+∞) type: floating point number

scaleRepeatTime

get scaleRepeatTime(): number other

set scaleRepeatTime(newTime): void other

Obtain the zoom one-way motion time

Returns

numberRepeat time

Set the scale repeat time. This property will take effect only when the repeated motion state is true

Parameters

newTime numberUsage: repeat time range: (0,+∞) type: floating point

scaleReturnDelay

get scaleReturnDelay(): number other

set scaleReturnDelay(newDelay): void other

Obtain the pause time after scaling the return trip

Returns

numberPause time after returning

Set the pause time after scaling the return trip. This attribute will only take effect when the motion state is set to true repeatedly

Parameters

newDelay numberUsage: Pause time after return range: (0,+∞) type: Floating point number

scaleSpeed

get scaleSpeed(): Vector other

set scaleSpeed(newSpeed): void other

Get scale speed

Usage example: create a script named "IMExample4", place it in the object bar, open the script, enter the following code to save it, run the game, and you will see two cubes in the scene, demonstrating whether there is non repeated scale that starts late, and whether there is repeated scale that stops at the start and end. The code is as follows:

ts
@Component
export default class IMExample4 extends mw.Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if (Util.SystemUtil.isClient()) {
            // Create Box 1 and Box 2
            this.Obj1 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            this.Obj2 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            // Set starting position
            this.Obj1.worldTransform.position = new mw.Vector(300.0, 200.0, 200.0);
            this.Obj2.worldTransform.position = new mw.Vector(300.0, -200.0, 200.0);
            // Set Start scale
            this.Obj1.worldTransform.scale = new mw.Vector(1.0, 1.0, 1.0);
            this.Obj2.worldTransform.scale = new mw.Vector(1.0, 1.0, 1.0);

            // Create Mover 1 and Mover 2, and mount them onto the corresponding rectangular prism
            this.IM1 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM1.attachToGameObject(this.Obj1);
            this.IM1.enable = true;

            this.IM2 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM2.attachToGameObject(this.Obj2);
            this.IM2.enable = true;

            // Integrated Mover 1 and 2 both set the same scale speed, and Integrated Mover 2 set a delay of five seconds to start
            this.IM1.scaleSpeed = new mw.Vector(-0.1, -0.1, -0.1);
            this.IM1.scaleRepeat = false;
            this.IM1.scaleDelayStartTime = 0.0;

            this.IM2.scaleSpeed = new mw.Vector(-0.1, -0.1, -0.1);
            this.IM2.scaleRepeat = false;
            this.IM2.scaleDelayStartTime = 5.0;
            // Integrated Mover 2 binding delay start callback
            this.IM2.onScaleEnable.add(() => {
                console.log("IM2 enabled with a delay");
            })

            // After waiting for ten seconds, return the box 1 and 2, reset the Integrated Mover 1 and 2, and let them become the repeated motion mode, and set a two second delay at the start and end of the Integrated Mover 2
            setTimeout(() => {
                this.IM1.moverReset();
                this.IM2.moverReset();

                this.IM1.scaleRepeat = true;
                this.IM1.scaleRepeatTime = 2.0;
                this.IM1.scaleDelayStartTime = 0.0;
                this.IM1.scaleRepeatDelay = 0.0;
                this.IM1.scaleReturnDelay = 0.0;

                this.IM2.scaleRepeat = true;
                this.IM2.scaleRepeatTime = 2.0;
                this.IM2.scaleDelayStartTime = 0.0;
                this.IM2.scaleRepeatDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onScaleReturn.add(() => {
                    console.log("IM2 paused at end point");
                })
                this.IM2.scaleReturnDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onScaleStart.add(() => {
                    console.log("IM2 paused at start point");
                })
            }, 10000);
        }
    }

    //
    // Periodic function executed per frame
    // This function requires assigning the value 'this.useUpdate' to 'true' for execution
    // @param dt Delay between current frame and previous frame in seconds
    protected onUpdate(dt: number): void {

    }

    // Call this function after the last frame is executed when the script is destroyed
    protected onDestroy(): void {

    }
}
@Component
export default class IMExample4 extends mw.Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if (Util.SystemUtil.isClient()) {
            // Create Box 1 and Box 2
            this.Obj1 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            this.Obj2 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            // Set starting position
            this.Obj1.worldTransform.position = new mw.Vector(300.0, 200.0, 200.0);
            this.Obj2.worldTransform.position = new mw.Vector(300.0, -200.0, 200.0);
            // Set Start scale
            this.Obj1.worldTransform.scale = new mw.Vector(1.0, 1.0, 1.0);
            this.Obj2.worldTransform.scale = new mw.Vector(1.0, 1.0, 1.0);

            // Create Mover 1 and Mover 2, and mount them onto the corresponding rectangular prism
            this.IM1 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM1.attachToGameObject(this.Obj1);
            this.IM1.enable = true;

            this.IM2 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM2.attachToGameObject(this.Obj2);
            this.IM2.enable = true;

            // Integrated Mover 1 and 2 both set the same scale speed, and Integrated Mover 2 set a delay of five seconds to start
            this.IM1.scaleSpeed = new mw.Vector(-0.1, -0.1, -0.1);
            this.IM1.scaleRepeat = false;
            this.IM1.scaleDelayStartTime = 0.0;

            this.IM2.scaleSpeed = new mw.Vector(-0.1, -0.1, -0.1);
            this.IM2.scaleRepeat = false;
            this.IM2.scaleDelayStartTime = 5.0;
            // Integrated Mover 2 binding delay start callback
            this.IM2.onScaleEnable.add(() => {
                console.log("IM2 enabled with a delay");
            })

            // After waiting for ten seconds, return the box 1 and 2, reset the Integrated Mover 1 and 2, and let them become the repeated motion mode, and set a two second delay at the start and end of the Integrated Mover 2
            setTimeout(() => {
                this.IM1.moverReset();
                this.IM2.moverReset();

                this.IM1.scaleRepeat = true;
                this.IM1.scaleRepeatTime = 2.0;
                this.IM1.scaleDelayStartTime = 0.0;
                this.IM1.scaleRepeatDelay = 0.0;
                this.IM1.scaleReturnDelay = 0.0;

                this.IM2.scaleRepeat = true;
                this.IM2.scaleRepeatTime = 2.0;
                this.IM2.scaleDelayStartTime = 0.0;
                this.IM2.scaleRepeatDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onScaleReturn.add(() => {
                    console.log("IM2 paused at end point");
                })
                this.IM2.scaleReturnDelay = 2.0;
                // Athlete 2 binding endpoint pause callback
                this.IM2.onScaleStart.add(() => {
                    console.log("IM2 paused at start point");
                })
            }, 10000);
        }
    }

    //
    // Periodic function executed per frame
    // This function requires assigning the value 'this.useUpdate' to 'true' for execution
    // @param dt Delay between current frame and previous frame in seconds
    protected onUpdate(dt: number): void {

    }

    // Call this function after the last frame is executed when the script is destroyed
    protected onDestroy(): void {

    }
}

Returns

VectorScale speed

Set the zoom speed size

Parameters

newSpeed VectorScale speed

smooth

get smooth(): boolean other

set smooth(newSmooth): void other

Obtain smooth state

Returns

booleanSmooth state

Set the smooth state, and when enabled, the motion speed will gradually increase from slow to maximum

Parameters

newSmooth booleanUsage: Smooth state

swingAngle

get swingAngle(): number other

set swingAngle(newAngle): void other

Obtain the maximum swing angle

Returns

numberMaximum swing angle

Set the maximum swing angle

Parameters

newAngle numberUsage: Maximum swing angle range: (0,+∞) type: Floating point number

swingDelayStartTime

get swingDelayStartTime(): number other

set swingDelayStartTime(newDelay): void other

Obtain the delay start swing running time

Returns

numberDelay start time

Set delay start swing motion time

Parameters

newDelay numberUsage: Delay startup time range: (0,+∞) type: Floating point number

swingSpeed

get swingSpeed(): Vector other

set swingSpeed(newSpeed): void other

Obtain the speed of swinging motion

Usage example: create a script named "IMExample5", place it in the object bar, open the script, enter the following code to save it, run the game, and you will see two boxes in the scene to demonstrate whether there is a delay in starting the pendulum motion. The code is as follows:

ts
@Component
export default class IMExample5 extends mw.Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if (Util.SystemUtil.isClient()) {
            // Create Box 1 and Box 2
            this.Obj1 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            this.Obj2 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            // Set starting position
            this.Obj1.worldTransform.position = new mw.Vector(300.0, 200.0, 200.0);
            this.Obj2.worldTransform.position = new mw.Vector(300.0, -200.0, 200.0);
            // Set Start scale
            this.Obj1.worldTransform.scale = new mw.Vector(0.5, 2.0, 0.5);
            this.Obj2.worldTransform.scale = new mw.Vector(0.5, 2.0, 0.5);

            // Create Mover 1 and Mover 2, and mount them onto the corresponding rectangular prism
            this.IM1 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM1.attachToGameObject(this.Obj1);
            this.IM1.enable = true;

            this.IM2 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM2.attachToGameObject(this.Obj2);
            this.IM2.enable = true;

            // Both motor 1 and motor 2 are set to the same pendulum speed and angle, and motor 2 is set to start with a delay of five seconds
            this.IM1.swingSpeed = new mw.Vector(1.0, 0.0, 0.0);
            this.IM1.swingAngle = 90.0;
            this.IM1.swingDelayStartTime = 0.0;

            this.IM2.swingSpeed = new mw.Vector(1.0, 0.0, 0.0);
            this.IM2.swingAngle = 90.0;
            this.IM2.swingDelayStartTime = 5.0;
            // Integrated Mover 2 binding delay start callback
            this.IM2.onSwingEnable.add(() => {
                console.log("IM2 enabled with a delay");
            })
        }
    }

    //
    // Periodic function executed per frame
    // This function requires assigning the value 'this.useUpdate' to 'true' for execution
    // @param dt Delay between current frame and previous frame in seconds
    protected onUpdate(dt: number): void {

    }

    // Call this function after the last frame is executed when the script is destroyed
    protected onDestroy(): void {

    }
}
@Component
export default class IMExample5 extends mw.Script {

    // Declare variables
    Obj1;
    Obj2;
    IM1;
    IM2;

    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if (Util.SystemUtil.isClient()) {
            // Create Box 1 and Box 2
            this.Obj1 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            this.Obj2 = await mw.GameObject.asyncSpawn("197386") as mw.GameObject;
            // Set starting position
            this.Obj1.worldTransform.position = new mw.Vector(300.0, 200.0, 200.0);
            this.Obj2.worldTransform.position = new mw.Vector(300.0, -200.0, 200.0);
            // Set Start scale
            this.Obj1.worldTransform.scale = new mw.Vector(0.5, 2.0, 0.5);
            this.Obj2.worldTransform.scale = new mw.Vector(0.5, 2.0, 0.5);

            // Create Mover 1 and Mover 2, and mount them onto the corresponding rectangular prism
            this.IM1 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM1.attachToGameObject(this.Obj1);
            this.IM1.enable = true;

            this.IM2 = await mw.GameObject.asyncSpawn("PhysicsSports") as mw.IntegratedMover;
            this.IM2.attachToGameObject(this.Obj2);
            this.IM2.enable = true;

            // Both motor 1 and motor 2 are set to the same pendulum speed and angle, and motor 2 is set to start with a delay of five seconds
            this.IM1.swingSpeed = new mw.Vector(1.0, 0.0, 0.0);
            this.IM1.swingAngle = 90.0;
            this.IM1.swingDelayStartTime = 0.0;

            this.IM2.swingSpeed = new mw.Vector(1.0, 0.0, 0.0);
            this.IM2.swingAngle = 90.0;
            this.IM2.swingDelayStartTime = 5.0;
            // Integrated Mover 2 binding delay start callback
            this.IM2.onSwingEnable.add(() => {
                console.log("IM2 enabled with a delay");
            })
        }
    }

    //
    // Periodic function executed per frame
    // This function requires assigning the value 'this.useUpdate' to 'true' for execution
    // @param dt Delay between current frame and previous frame in seconds
    protected onUpdate(dt: number): void {

    }

    // Call this function after the last frame is executed when the script is destroyed
    protected onDestroy(): void {

    }
}

Returns

VectorSwing motion speed

Set the swing motion speed

Parameters

newSpeed VectorUsage: Swing motion speed

Methods


moverReset

moverReset(OnReset?): void other

Reset the state of the motion device and return the moving object to its initial position simultaneously

Parameters

OnReset? () => voidUsage: Execute callback default: null