moveObject | Multi Theft Auto: Wiki Skip to content

moveObject

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function will smoothly move an object from its current position to a specified rotation and position.

Syntax

moveObject ( )

Code Examples

server

Example 1:This example moves every object in the game up 100 units in ten seconds.

allObjects = getElementsByType ( "object" )
for key, theObject in ipairs ( allObjects ) do
local origX, origY, origZ = getElementPosition ( theObject ) --get the original position
local newZ = origZ + 100 -- make a new z position
moveObject ( theObject, 10000, origX, origY, newZ ) --move the object to this position in 10 seconds.
end

Issues

ID Description
549 Object rotation is wrong after moveObject serverside