moveObject
Shared
Moves an object smoothly to a position, turning it along the way.
bool moveObject(element object, int time, float x, y, z [, float rx, ry, rz = 0, 0, 0, string easingType = "Linear", float easingPeriod = 0.3, float easingAmplitude = 1, float easingOvershoot = 1.70158])
Parameters
| Name | Type | Description |
|---|---|---|
| object | element | The object. It may also be a parent element: every object below it moves. |
| time | int | The duration in milliseconds. With 0 or less, the object goes straight to the destination. |
| x, y, z | float | The destination. A vec3 also works. |
| rx, ry, rz | float | How much to turn during the movement, in degrees, added to the current rotation. A vec3 also works.default 0, 0, 0 |
| easingType | string | The easing curve, such as "Linear", "InOutQuad", "OutBounce" or "SineCurve".default "Linear" |
| easingPeriod | float | The period of the elastic curves.default 0.3 |
| easingAmplitude | float | The amplitude of the elastic and bounce curves.default 1 |
| easingOvershoot | float | How far the Back curves overshoot the target.default 1.70158 |
Returns
true if the element given is an object.
On the server, the movement reaches every client. A new moveObject replaces the movement under way.
Example
local gate = createObject("electricgate", 2500.0, -1680.0, 13.0)
addCommandHandler("opengate", function()
moveObject(gate, 3000, 2500.0, -1680.0, 7.0, 0, 0, 0, "InOutQuad")
end)