moveObject
Client-side
Server-side
Shared
Manual Review Required
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.
OOP Syntax Help! I don't understand this!
- Method:object:move(...)
Syntax
bool moveObject ( object theObject, int time, float targetx, float targety, float targetz, float moverx, float movery, float moverz, string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot )Required Arguments
- theObject: the object that will be moved.
- time: the time in milliseconds the object will arrive at the destination.
- targetx: the X value of the target position
- targety: the Y value of the target position
- targetz: the Z value of the target position
- moverx: the rotation along the X axis relative to its current rotation, which is its starting angle.
- movery: the rotation along the Y axis relative to its current rotation, which is its starting angle.
- moverz: the rotation along the Z axis relative to its current rotation, which is its starting angle.
- strEasingType: the easing function to use for the interpolation (default is "Linear")
- fEasingPeriod: the period of the easing function (only some easing functions use this parameter)
- fEasingAmplitude: the amplitude of the easing function (only some easing functions use this parameter)
- fEasingOvershoot: the overshoot of the easing function (only some easing functions use this parameter)
Returns
- bool: value
Code Examples
shared
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.endIssues
| ID | Description |
|---|---|
| 549 | Object rotation is wrong after moveObject serverside |