Entity
Defined in: client/api.d.ts:2837
Base handle for a live replicated network entity.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Entity(
id):Entity
Defined in: client/api.d.ts:2842
Creates a script wrapper for an existing entity with this ID; it does not spawn an entity.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Entity
Methods
Section titled “Methods”setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: client/api.d.ts:2874
Moves this entity into another virtual world.
Parameters
Section titled “Parameters”number
Virtual-world identifier used to partition replication and visibility.
Returns
Section titled “Returns”void
setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: client/api.d.ts:2880
Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: client/api.d.ts:2868
Formats this entity handle for logging and debugging.
Returns
Section titled “Returns”string
Text containing the network entity ID.
Properties
Section titled “Properties”
readonlyid:number
Defined in: client/api.d.ts:2847
Immutable network entity identifier.
position
Section titled “position”position:
Vector3
Defined in: client/api.d.ts:2857
Authoritative world-space position; assignment forces replicated state.
rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: client/api.d.ts:2862
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: client/api.d.ts:2852
Current virtual-world identifier.
