SScript

Functions

TypeName

string TypeName (DynValue dv)

Return the type name of the value.

Parameter
Type
Description

dv

DynValue

typeName = Space.TypeName("123")

TrackingAllowed

bool TrackingAllowed (string key)

Returns true on white-label grids when the user has opted into tracking for the given key. Always returns false on the main grid.

Parameter
Type
Description

key

string

A unique identifier used to store and look up the user's tracking consent.

isTrackingAllowed = Space.TrackingAllowed('3423423423423')

TrackingRequest

void TrackingRequest (string key, string privacynotice, Closure callback, bool force=false)

Displays a consent prompt (EULA-style) asking the user to allow tracking for a given key. On white-label grids, stores the user's choice and invokes the callback with a boolean indicating consent. On the main grid, this does nothing.

Parameter
Type
Description

key

string

A unique identifier used to store and look up the user's tracking consent.

privacynotice

string

The privacy notice text to display in the consent dialog.

callback

Closure

A function invoked with one boolean parameter: true if allowed, false otherwise.

force

bool

If true, show the prompt even if a stored decision exists. Defaults to false.

GetResource

SResource GetResource (string name)

Returns a reference to a SResource using it's Resource name.

Parameter
Type
Description

name

string

Name of the Resource as set in the Scripting Runtime Component (Resources section)

LogEvent

void LogEvent (string eventName, float value, SVector position)

Logs an analytics event to the server on white-label grids.

Parameter
Type
Description

eventName

string

The name of the analytics event.

value

float

A numeric value associated with the event.

position

SVector

A world position to associate with the event.

Log

void Log (DynValue text, bool logToFile=false) void Log (string text, bool logToFile=false)

Log a message to console.

Parameter
Type
Description

Properties

Inventory

SInventory Inventory get

Allows access to the users inventory

Persistence

SPersistence Persistence get

Stores information between user sessions, and for other users

Scene

SScene Scene get

Allows access to the current scene graph (objects and avatars in the scene, and other information)

Grid

SGrid Grid get

Property Description

Host

SHost Host get

Access information about the current scripting runtime host

Physics

SPhysics Physics get

Call physics-related commands, and variables, such as raycasting

Math

SMath Math get

Math related functions (Sin, Cos, Tan, etc)

String

SString String get

Miscellaneous additional string functions (e.g. MD5Sum)

Input

SInput Input get

Input device related functions (mouse position, keyboard state)

Camera

SCameraManager Camera get

Take and control the users camera

WebServices

SWebService WebServices get

Call remote web services to designated hosts (will not work with arbitrary domains, see page for details)

Network

SNetwork Network get

Send data to other clients through the region server

PostFX

SPostFX PostFX get

Property Description

AudioAnalyser

SAudioAnalyser AudioAnalyser get

Property Description

Tween

STween Tween get

Property Description

UI

SUI UI get

Property Description

Dialogues

SDialogues Dialogues get

Property Description

Shared

SShared Shared get

Property Description

Quests

SQuests Quests get

Property Description

Economy

SEconomy Economy get

Property Description

Groups

SGroup Groups get

Property Description

Activity

SActivity Activity get

Property Description

RenderSettings

SRenderSettings RenderSettings get

Property Description

Profile

SProfile Profile get

Property Description

Photos

SPhotos Photos get

Property Description

Videos

SVideos Videos get

Property Description

MusicDirectory

SMusicDirectory MusicDirectory get

Property Description

Journey

SJourney Journey get

Property Description

GameTester

SGameTester GameTester get

Property Description

RuntimeType

string RuntimeType get

Return current RuntimeType name.

Platform

string Platform get

Return current platform name.

SessionID

string SessionID get

Return current SessionID.

InEditor

bool InEditor get

Return true if in unity editor.

Version

int Version get

Returns the numeric build version of the viewer (for programmatic comparisons). In the Unity Editor this returns int.MaxValue; if unknown at runtime it returns -1.

FullVersionString

string FullVersionString get

Returns the full build version display string tied to release notes (e.g., "2025.6f210"). Best for user-facing display and logging.

Resources

SResource[] Resources get

Property Description

Time

float Time get

Returns time at the beginning of this frame.

ServerTime

string ServerTime get

Returns current server time.

LocalTime

string LocalTime get

Returns current local time.

LoginTime

float LoginTime get

Returns how long player has been logged in (in seconds).

ServerTimeUnix

int ServerTimeUnix get

Returns the server time unix timestamp.

LocalTimeUnix

int LocalTimeUnix get

Returns the local time unix timestamp.

DeltaTime

float DeltaTime get

The completion time in seconds since the last frame.

PreviewServer

bool PreviewServer get

Return true if in preview server.

ComponentName

string ComponentName get

The name of this component.

Last updated

Was this helpful?