LocalObjects
constLocalObjects:object
Defined in: client/api.d.ts:588
Objects only the local player sees: the server and the other players never learn of them. Each stays in the cell or worldspace the local player was in when it was created, and shows again on coming back there. The resource that created one owns it: it is removed once that resource stops, and every one on disconnect.
Type Declaration
Section titled “Type Declaration”create()
Section titled “create()”create(
form,placement,onLoad?):number
Places an object in the local player’s cell or worldspace; it appears over the next frames. The object’s ID, or 0 when the form is unknown or not scenery, or 512 objects already exist.
Parameters
Section titled “Parameters”string | number
The form ID of scenery: a static, movable static, static collection, tree or light. Nothing that can be taken, looted or activated. Editor IDs are not accepted: the game drops them for these types once loaded.
placement
Section titled “placement”World units, and radians about the X, Y and Z axes; yaw 0 faces +Y, clockwise.
pitch?
Section titled “pitch?”number
number
number
number
number
number
onLoad?
Section titled “onLoad?”(id) => void
Called each time the object’s 3D is loaded, the first time included. Not called once this resource stops.
Returns
Section titled “Returns”number
exists()
Section titled “exists()”exists(
id):boolean
Whether the object still exists: not removed, not refused by the game, and its resource still running.
Parameters
Section titled “Parameters”number
From create.
Returns
Section titled “Returns”boolean
getPose()
Section titled “getPose()”getPose(
id): {pitch:number;roll:number;x:number;y:number;yaw:number;z:number; } |null
Where an object stands and how it is turned, as it was last placed or moved: world units and radians. Null when there is no such object.
Parameters
Section titled “Parameters”number
From create.
Returns
Section titled “Returns”{ pitch: number; roll: number; x: number; y: number; yaw: number; z: number; } | null
remove()
Section titled “remove()”remove(
id):boolean
Removes an object. False when there is no such object.
Parameters
Section titled “Parameters”number
From create.
Returns
Section titled “Returns”boolean
setPosition()
Section titled “setPosition()”setPosition(
id,x,y,z):boolean
Moves an object within its cell or worldspace. False when there is no such object.
Parameters
Section titled “Parameters”number
From create.
number
World units.
number
World units.
number
World units.
Returns
Section titled “Returns”boolean
setRotation()
Section titled “setRotation()”setRotation(
id,pitch,roll,yaw):boolean
Turns an object. False when there is no such object.
Parameters
Section titled “Parameters”number
From create.
number
Radians about X.
number
Radians about Y.
number
Radians about Z.
Returns
Section titled “Returns”boolean