Skip to content

World

The global world variable is always available within the app scripting runtime.

A unique ID for the current server or client.

Whether the script is currently executing on the server.

Whether the script is currently executing on the client.

Adds a node into world-space, outside of the apps local hierarchy.

Removes a node from world-space, outside of the apps local hierarchy.

Adds a node into world-space, maintaining its current world transform.

Subscribes to world events. Currently only enter and leave are available which let you know when a player enters or leaves the world.

Unsubscribes from world events.

.raycast(origin: Vector3, direction: Vector3, maxDistance: ?Number, layerMask: ?Number)

Section titled “.raycast(origin: Vector3, direction: Vector3, maxDistance: ?Number, layerMask: ?Number)”

Raycasts the physics scene. If maxDistance is not specified, max distance is infinite. If layerMask is not specified, it will hit anything.

Creates a bitmask to be used in world.raycast(). Currently the only groups available are environment and player.

Returns a player. If no playerId is provided it returns the local player.

Returns an array of all players.