objects.setTransform
Moves or turns the object in world coordinates. A timed edit starts from its current position and rotation, including when it replaces a move in progress. Scale applies immediately and affects appearance. Collision keeps the game’s original shape.
Signature
Section titled “Signature”objects.setTransform(id: number, transform: ScriptObjectTransform, durationMs?: number): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The ID from objects.create. |
transform |
ScriptObjectTransform |
Fields to change. |
durationMs |
number |
Whole milliseconds from 0 to 600,000. Zero applies the edit immediately. |
Returns
Section titled “Returns”An ActionResult. A timed edit returns applied when it starts. Invalid settings return invalid-position, invalid-rotation, invalid-scale, invalid-duration or empty-transform. At most 256 objects may move or turn at once (object-motion-limit). Detach an attached object before changing its position or rotation (object-attached).
Example
Section titled “Example”import { objects } from "nativemp";
const gateId = 268435457;await objects.setTransform(gateId, { position: [1756, -2490, 18], rotationDegrees: [0, 0, 90] }, 2500);