Rotating 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 rotating them. An example of how to rotate objects is below:
lua
1while true do2 Object.rotate(3 2, -- Target group ID4 1, -- Center group ID5 90, -- Degrees6 0, -- Times to rotate 360 degrees7 1, -- Duration8 0, -- Easing type9 2 -- Easing rate10 )11 wait(1) -- Waits 1 second (look at wait docs)12end
The code above rotates all the objects in group ID 1 90 degrees over 1 second.
| Parameter | Type | Default | Description |
|---|---|---|---|
targetGroup | integer | - | Group to scale. |
centerGroup | integer | - | Pivot group. |
degrees | integer | - | Rotation angle. |
times360 | integer | 0 | Extra full 360° rotations. |
duration | number | 0 | Rotation duration. |
easingType | number | 0 | Easing type (look at easing type docs). |
easingRate | number | 2 | Easing rate (look at easing rate docs). |
