M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
objectelementThe object. It may also be a parent element: every object below it moves.
timeintThe duration in milliseconds. With 0 or less, the object goes straight to the destination.
x, y, zfloatThe destination. A vec3 also works.
rx, ry, rzfloatHow much to turn during the movement, in degrees, added to the current rotation. A vec3 also works.default 0, 0, 0
easingTypestringThe easing curve, such as "Linear", "InOutQuad", "OutBounce" or "SineCurve".default "Linear"
easingPeriodfloatThe period of the elastic curves.default 0.3
easingAmplitudefloatThe amplitude of the elastic and bounce curves.default 1
easingOvershootfloatHow 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)

See also