GD Resources logo

Rotating Objects #

OmgRod avatar
Written by:
OmgRod
Owner

Lua 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 do
2 Object.rotate(
3 2, -- Target group ID
4 1, -- Center group ID
5 90, -- Degrees
6 0, -- Times to rotate 360 degrees
7 1, -- Duration
8 0, -- Easing type
9 2 -- Easing rate
10 )
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.

Object.rotate() parameters
ParameterTypeDefaultDescription
targetGroupinteger-Group to scale.
centerGroupinteger-Pivot group.
degreesinteger-Rotation angle.
times360integer0Extra full 360° rotations.
durationnumber0Rotation duration.
easingTypenumber0Easing type (look at easing type docs).
easingRatenumber2Easing rate (look at easing rate docs).