Scripting/SScene
The SScene class represents the region the user is currently in.
Contents
Members
Find
Finds a single Game Object matching 'Name' and returns it. Can use '/' characters to designate a path (e.g. 'Parent/Child' returns Child with 'Parent')
PlayerAvatar
Returns the current player avatar. If this script is calling this upon initialisation, the Player may not exist yet, and you will want to wait a few frames until the avatar is present before continuing.
Avatars[]
Returns a list of Avatars in the scene
Objects[]
Returns a list of Objects in the scene. IMPORTANT: This function is slow, you should cache the result and avoid calling this every frame.
CreateGameObject
Creates a new empty game object with the name 'Name' and returns a reference
CreateGameObject
Creates a game object from the specified resource
Name
Returns the name of the current region
Url
Returns the URL of the current region
Owner
Returns the avatar ID of the regions owner
PlayerIsOwner
Returns whether the current player is the owner of the region
OnPlayerJoin
Event which fires whenever a player joins the region
OnPlayerLeave
Event which fires whenever a player leaves the region
|