Moving Objects #
Written by:
OmgRod
OwnerLua Trigger lets you interact with objects through group IDs. One of the ways you can interact with objects is by moving them. An example of how to move objects is below:
lua
1while true do2 Object.move(3 1, -- All objects in group ID 14 30, -- Moves object 30 units (1 block) to the right5 30, -- Moves object 30 units (1 block) up6 1 -- Over 1 second7 )8 wait(1) -- Waits 1 second (look at wait docs)9end
The code above moves all the objects in group ID 1 30 units up and 30 units right over the duration of 1 second.
| Parameter | Type | Default | Description |
|---|---|---|---|
| Group ID | number | - | The Target Group ID of the objects you want to move. |
| Move X | number | - | Horizontal distance to move in units (30 units = 1 block). Positive moves right, negative moves left. |
| Move Y | number | - | Vertical distance to move in units (30 units = 1 block). Positive moves up, negative moves down. |
| Duration | number | 0 | The time in seconds over which the movement takes place. |
easingType | number | 0 | Easing type (look at easing type docs). |
easingRate | number | 2 | Easing rate (look at easing rate docs). |
