Skip to content

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.

objects.setTransform(id: number, transform: ScriptObjectTransform, durationMs?: number): Promise<ActionResult>
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.

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).

gamemodes/my-mode.ts
import { objects } from "nativemp";
const gateId = 268435457;
await objects.setTransform(gateId, { position: [1756, -2490, 18], rotationDegrees: [0, 0, 90] }, 2500);