All pages
Powered by GitBook
1 of 65

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Components

SAudioReactiveAnimation

Index

Properties Index

Property Name

Properties

Enabled

bool Enabled get set

Returns true if the Audio Reactive Animation Enabled.

Target

Target get set

The target Animator which the Audio Reactive Animation is affecting.

Parameter

string Parameter get set

The Parameter value which the Audio Reactive Animation is affecting in the target Animator.

GameObject

GameObject get

Returns a reference to the GameObject of this component.

SAudioReactiveMaterial

Index

Properties Index

Property Name

Properties

Enabled

bool Enabled get set

Returns true if the Audio Reactive Material Enabled.

Target

Target get set

Property Description

OriginalMaterial

OriginalMaterial get set

Property Description

TargetMaterial

TargetMaterial get set

Property Description

GameObject

GameObject get

Returns a reference to the GameObject of this component.

SBoxCollider

Index

Properties Index

Property Name

SCanvasGroup

Index

Properties Index

Property Name

SContentSizeFitter

Index

Functions Index

Function Name

SReflectionProbe

Index

Functions Index

Function Name

SUIToolTipHint

Index

Properties Index

Property Name

bool Enabled get set

SAnimator Target get set

string Parameter get set

SAnimator
SGameObject
Space.Host.ExecutingObject.AudioReactiveAnimation.Enabled = false
--clicking this object will Enable/Disable it's Audio Reactive Animation component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveAnimation


OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

bool Enabled get set

SMaterial Target get set

SMaterial OriginalMaterial get set

SMaterial TargetMaterial get set

SMaterial
SMaterial
SMaterial
SGameObject
Space.Host.ExecutingObject.AudioReactiveMaterial.Enabled = false
--clicking this object will Enable/Disable it's Audio Reactive Material component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveMaterial


OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
TargetAnimator = Space.Host.ExecutingObject.AudioReactiveAnimation.Target
--clicking this object toggles between two Audio Reactive Animation targets

thisObject = Space.Host.ExecutingObject
animator1 = Space.Host.GetReference("object1").Animator --add this reference to Scripting Runtime component
animator2 = Space.Host.GetReference("object2").Animator --add this reference to Scripting Runtime component

OnClick = function()
if thisObject.AudioReactiveAnimation.Target == animator1 then
  thisObject.AudioReactiveAnimation.Target = animator2
else
  thisObject.AudioReactiveAnimation.Target = animator1
end

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.SAudioReactiveAnimation.Parameter = "param2"
--clicking this object toggles between two Audio Reactive Animation parameters

thisObject = Space.Host.ExecutingObject
parameter1 = "theParamName"
parameter2 = "theParamName2"

OnClick = function()
if thisObject.AudioReactiveAnimation.Parameter == parameter1 then
  thisObject.AudioReactiveAnimation.Parameter = parameter2
else
  thisObject.AudioReactiveAnimation.Parameter = parameter1
end

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
theGameObject = Space.Host.ExecutingObject.AudioReactiveAnimation.GameObject
Space.Host.ExecutingObject.AudioReactiveMaterial.Target = AMaterial
Space.Host.ExecutingObject.AudioReactiveMaterial.OriginalMaterial = AMaterial
Space.Host.ExecutingObject.AudioReactiveMaterial.TargetMaterial = AMaterial
theGameObject = Space.Host.ExecutingObject.AudioReactiveMaterial.GameObject

SVector get set

SVector get set

bool get set

bool get set

Properties

Center

SVector Center get set

The position of the center of the Box Collider.

Center = Space.Host.ExecutingObject.BoxCollider.Center
--clicking this object moves it's Box Collider's center one unit upwards

thisObject = Space.Host.ExecutingObject

OnClick = function()
center = thisObject.BoxCollider.Center

thisObject.BoxCollider.Center = Vector.New(center.X,center.Y + 1, center.Z)


Size

SVector Size get set

The size of the box.

Enabled

bool Enabled get set

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

IsTrigger

bool IsTrigger get set

Is the collider a trigger?

GameObject

SGameObject GameObject get

Returns a reference to the GameObject of this component.

float get set

bool get set

bool get set

bool get set

Properties

Alpha

float Alpha get set

Set the alpha of the group.

Space.Host.CanvasGroup.Alpha = 1.0

BlocksRaycasts

bool BlocksRaycasts get set

Does this group block raycasting (allow collision)?

IgnoreParentGroups

bool IgnoreParentGroups get set

Should the group ignore parent groups?

Interactable

bool Interactable get set

Is the group interactable (are the elements beneath the group enabled)?

GameObject

SGameObject GameObject get

Returns a reference to the GameObject of this component.

void ()

void ()

void ()

Properties Index

Property Name

bool get set

SGameObject get

Functions

SetLayoutHorizontal

void SetLayoutHorizontal ()

Function Description

Space.Host.ExecutingObject.ContentSizeFitter.SetLayoutHorizontal()

SetLayoutVertical

void SetLayoutVertical ()

Function Description

RefreshLayout

void RefreshLayout ()

Function Description

Properties

Enable

bool Enable get set

Property Description

GameObject

SGameObject GameObject get

Property Description

void ()

Properties Index

Property Name

SVector get set

SVector get set

SGameObject get

Functions

RenderProbe

void RenderProbe ()

Refreshes the probe's cubemap.

Space.Host.ExecutingObject.ReflectionProbe.RenderProbe()

Properties

Center

SVector Center get set

The center of the box area in which reflections will be applied to the objects. Measured in the probe's local space.

Size

SVector Size get set

The size of the box area in which reflections will be applied to the objects. Measured in the probe's local space.

GameObject

SGameObject GameObject get

Property Description

bool get set

string get set

SResource get set

SGameObject get

Properties

Enabled

bool Enabled get set

Get or set whether the tool tip component is Enabled.

Space.Host.ExecutingObject.UIToolTipHint.Enabled = true

Text

string Text get set

Get or set the string value this tool tip displays.

Texture

SResource Texture get set

Get or set the tooltip's texture.

GameObject

SGameObject GameObject get

Property Description

SAudioReactiveParticleSystem

Index

Properties Index

Property Name

SCollider

Index

Properties Index

Property Name

SEventCalendar

Index

Functions Index

Function Name

SFurniture

Index

Functions Index

Function Name

SPlayableDirector

Index

Functions Index

Function Name

SPostProcessVolume

Index

Properties Index

Property Name

SRoomFloor

Index

Properties Index

Property Name

SScriptingData

Index

Functions Index

Function Name

SUICanvas

Index

Properties Index

Property Name
Size= Space.Host.ExecutingObject.BoxCollider.Size
--clicking this object increases it's Box Collider's size by one unit

thisObject = Space.Host.ExecutingObject

OnClick = function()
size = thisObject.BoxCollider.Size

thisObject.BoxCollider.Size = Vector.New(size.X + 1,size.Y + 1, size.Z + 1)

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.BoxCollider.Enabled = false
--clicking this object toggles it's Box Collider On/Off

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.BoxCollider.Enabled = not thisObject.BoxCollider.Enabled

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.BoxCollider.Enabled = true
--clicking this object toggles it's Box Collider between being a Collider and Trigger Collider

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.BoxCollider.IsTrigger = not thisObject.BoxCollider.IsTrigger

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
theGameObject = Space.Host.ExecutingObject.BoxCollider.GameObject
Space.Host.CanvasGroup.BlocksRaycasts = true
Space.Host.CanvasGroup.IgnoreParentGroups = true
Space.Host.CanvasGroup.Interactable = true
theGameObject = Space.Host.ExecutingObject.CanvasGroup.GameObject
Space.Host.ExecutingObject.ContentSizeFitter.SetLayoutVertical()
Space.Host.ExecutingObject.ContentSizeFitter.RefreshLayout()
Space.Host.ExecutingObject.ContentSizeFitter.Enable = true
theGameObject = Space.Host.ExecutingObject.ContentSizeFitter.GameObject
vectorCenter = Space.Host.ExecutingObject.ReflectionProbe.Center
vectorSize = Space.Host.ExecutingObject.ReflectionProbe.Size
theGameObject = Space.Host.ExecutingObject.ReflectionProbe.GameObject
Space.Host.ExecutingObject.UIToolTipHint.Text = "AToolTip"
Space.Host.ExecutingObject.UIToolTipHint.Texture = Space.GetResource("ResourceName")
theGameObject = Space.Host.ExecutingObject.UIToolTipHint.GameObject
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Center
Size
Enabled
IsTrigger
Alpha
BlocksRaycasts
IgnoreParentGroups
Interactable
SetLayoutHorizontal
SetLayoutVertical
RefreshLayout
Enable
GameObject
RenderProbe
Center
Size
GameObject
Enabled
Text
Texture
GameObject

bool get set

SGameObject get set

bool get set

SVector get set

SVector get set

bool get set

SVector get set

SVector get set

bool get set

SVector get set

SVector get set

Properties

Enabled

bool Enabled get set

Property Description

Target

SGameObject Target get set

Property Description

Position

bool Position get set

Property Description

MinPosition

SVector MinPosition get set

Property Description

MaxPosition

SVector MaxPosition get set

Property Description

Rotation

bool Rotation get set

Property Description

MinRotation

SVector MinRotation get set

Property Description

MaxRotation

SVector MaxRotation get set

Property Description

Scale

bool Scale get set

Property Description

MinScale

SVector MinScale get set

Property Description

MaxScale

SVector MaxScale get set

Property Description

GameObject

SGameObject GameObject get

Returns a reference to the GameObject of this component.

bool get set

bool get set

SGameObject get

Properties

Enabled

bool Enabled get set

Enable or disable the collider.

Space.Host.ExecutingObject.Collider.Enabled= false 
--clicking this object toggles it's Collider On/Off

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.Collider.Enabled = not thisObject.Collider.Enabled

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick

IsTrigger

bool IsTrigger get set

Set Collider as a trigger.

GameObject

SGameObject GameObject get

Property Description

void (int typeNumber)

void (int range)

Properties Index

Property Name

int get set

SGameObject get

Functions

SwitchEventType

void SwitchEventType (int typeNumber)

Function Description

Parameter
Type
Description

Space.Host.ExecutingObject.EventCalendar.SwitchEventType(1)

ChangeRange

void ChangeRange (int range)

Function Description

Parameter
Type
Description

Properties

Range

int Range get set

Property Description

GameObject

SGameObject GameObject get

Property Description

void (string key, string value)

string (string key)

Properties Index

Property Name

int get

SRoomFloor get

SCollider get

SGameObject get

Functions

StoreCustomData

void StoreCustomData (string key, string value)

Function Description

Parameter
Type
Description

GetCustomData

string GetCustomData (string key)

Function Description

Parameter
Type
Description

Properties

InventoryItemID

int InventoryItemID get

Return the inventory ID of furniture.

Floor

SRoomFloor Floor get

Return an SRoomFloor component of the floor this furniture is placed on.

MainCollider

SCollider MainCollider get

Property Description

GameObject

SGameObject GameObject get

Property Description

void ()

void ()

void ()

void ()

Properties Index

Property Name

int get

double get set

double get set

double get

SGameObject get

Functions

Play

void Play ()

Instantiates a Playable using the provided PlayableAsset and starts playback.

Stop

void Stop ()

Stop playback of the current Playable and destroys the corresponding graph.

Pause

void Pause ()

Pause playback of the currently running playable.

Resume

void Resume ()

Resume playing a paused playable.

Properties

State

int State get

The current playing state of the component.

Time

double Time get set

The component's current time. This value is incremented according to the PlayableDirector.timeUpdateMode when it is playing. You can also change this value manually.

InitialTime

double InitialTime get set

The time at which the Playable should start when first played.

Duration

double Duration get

The duration of the Playable in seconds.

GameObject

SGameObject GameObject get

Property Description

bool get set

bool get set

float? get set

float?? get set

float get set

SGameObject get

Properties

Enabled

bool Enabled get set

Enable or disable post effect volume.

Space.Host.ExecutingObject.PostProcessVolume.Enabled = true
--clicking this object will Enable/Disable it's Post Process Volume component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.PostProcessVolume

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()

IsGlobal

bool IsGlobal get set

Should this volume be applied to the whole scene?

BlendDistance

float? BlendDistance get set

The outer distance to start blending from. A value of 0 means no blending and the volume overrides will be applied immediately upon entry.

Weight

float?? Weight get set

The total weight of this volume in the scene. 0 means it won't do anything, 1 means full effect.

Priority

float Priority get set

The volume priority in the stack. Higher number means higher priority. Negative values are supported.

GameObject

SGameObject GameObject get

Property Description

bool get set

string get

string get

bool get

SGameObject[] get

int get

SGameObject get

Properties

Enabled

bool Enabled get set

Status of enable or disable room floor component

Space.Host.ExecutingObject.Floor.Enabled = false

Name

string Name get

Name of this floor

Description

string Description get

Description of this floor.

IsDefaultFloor

bool IsDefaultFloor get

Is this default floor?

Furniture

SGameObject[] Furniture get

Get all furniture game objects

Owner

int Owner get

Return the ID of the user account that owns this room floor, if any.

GameObject

SGameObject GameObject get

Property Description

object (string name)

void (string name, DynValue property, bool persistent=false)

Properties Index

Property Name

bool get set

string[] get

string get

SGameObject get

Functions

GetVariable

object GetVariable (string name)

Return the object of the variable.

Parameter
Type
Description

SetVariable

void SetVariable (string name, DynValue property, bool persistent=false)

Set properties to variable.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Is the ScriptingData component Enabled?

Variables

string[] Variables get

Property Description

ComponentName

string ComponentName get

The name of this component.

GameObject

SGameObject GameObject get

Property Description

bool get

float get set

float get set

bool get set

float get set

int get set

int get set

float get set

SGameObject get

Properties

IsRootCanvas

bool IsRootCanvas get

The avoidance radius for the agent.

ScaleFactor

float ScaleFactor get set

Scales all UI elements in the Canvas by this factor.

ReferencePixelsPerUnit

float ReferencePixelsPerUnit get set

If a sprite has this "Pixels Per Unit" setting, then one pixel in the sprite will cover one unit in the UI.

PixelPerfect

bool PixelPerfect get set

Should the UI be rendered without antialiasing for precision?

PlaneDistance

float PlaneDistance get set

The distance at which the UI plane should be placed in front of the camera.

SortingOrder

int SortingOrder get set

Canvas' order within a sorting layer.

TargetDisplay

int TargetDisplay get set

For Overlay mode, display index on which the UI canvas will appear.

NormalizedSortingGridSize

float NormalizedSortingGridSize get set

The normalized grid size that the canvas will split the renderable area into.

GameObject

SGameObject GameObject get

Property Description

SGraphicRaycaster

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

Raycast

Raycast ()

Perform the raycast against the list of graphics associated with the Canvas and returns first UI raycast result.

Parameter
Type
Description

Properties

SortOrderPriority

int SortOrderPriority get

Priority of the raycaster based upon render orderPriority of the raycaster based upon sort order.

RenderOrderPriority

int RenderOrderPriority get

Priority of the raycaster based upon render order.

GameObject

GameObject get

Property Description

SNavMeshObstacle

Index

Properties Index

Property Name

Properties

CarveOnlyStationary

bool CarveOnlyStationary get set

When enabled, the obstacle is carved only when it is stationary. (Only can enabled after carve was ticked).

Carving

bool Carving get set

When the Carve checkbox gets ticked, the Nav Mesh Obstacle creates a hole in the NavMesh.

Center

SVector Center get set

Center of the obstacle geometry relative to the transform position.

Height

float Height get set

Height of the capsule. (Property of Capsule shape).

Size

SVector Size get set

Size of the box. (Property of Box shape).

Radius

float Radius get set

Property Description

Shape

int Shape get set

Property Description

MoveThreshold

float MoveThreshold get set

Use this property to set the threshold distance for updating a moving carved hole. (Only can take effect after carve was ticked)

TimeToStationary

float TimeToStationary get set

The time to wait until the obstacle is treated as stationary. (Only can take effect after carve was ticked).

GameObject

GameObject get

Property Description

SNetworking

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

SendEvent

void SendEvent (string eventName)

Send a networking event event that will be received by other components in the scene with the same network name.

Parameter
Type
Description

ReceiveEvent

void ReceiveEvent (string eventName)

Invoke an event on the networking component. Normally not necessary to do manually, as this happens automatically when receiving a matching event over the network, but may be useful to initialize a state.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether the simple networking component is Enabled or not

Instanced

bool Instanced get

Returns whether this networking component is instanced or not.

NetworkName

string NetworkName get set

Returns or sets the name of the network. Network name must be at least 20 characters long without trailing or leading spaces.

Ready

bool Ready get

Return whether the networking component is ready to send or not (is initialized).

EventCount

int EventCount get

Return the number of events this component is waiting to receive.

EventNames

string[] EventNames get

Return a list of names of events that this component will receive.

GameObject

GameObject get

Property Description

SScriptingEvents

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

InvokeEvent

void InvokeEvent (string name)

Invoke the event with its name

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether the scriptingEvents component is enabled or not

Events

string[] Events get

Returns a list of events

ComponentName

string ComponentName get

The name of this component.

GameObject

GameObject get

Property Description

SSphereCollider

Index

Properties Index

Property Name

Properties

Center

Center get set

The center of the sphere in the object's local space.

Radius

float Radius get set

The radius of the sphere measured in the object's local space.

Enabled

bool Enabled get set

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

IsTrigger

bool IsTrigger get set

Is the collider a trigger?

GameObject

GameObject get

Property Description

SCloth

Index

Properties Index

Property Name

SUIScrollbar

Index

Functions Index

Function Name
Space.Host.ExecutingObject.AudioReactiveParticleSystem.Enabled = true
--clicking this object will Enable/Disable it's Audio Reactive Particle System component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveParticleSystem


OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
targetGameObject = Space.Host.ExecutingObject.AudioReactiveParticleSystem.Target
Space.Host.ExecutingObject.AudioReactiveParticleSystem.Position = true
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MinPosition = Vector.New(0,0,0)
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MaxPosition = Vector.New(10,10,10)
Space.Host.ExecutingObject.AudioReactiveParticleSystem.Rotation = true
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MinRotation = Vector.New(0,0,0)
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MaxRotation = Vector.New(10,10,10)
Space.Host.ExecutingObject.AudioReactiveParticleSystem.Scale = true
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MinScale = Vector.New(1,1,1)
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MaxScale = Vector.New(1.2,1.2,1.2)
theGameObject = Space.Host.ExecutingObject.AudioReactiveParticleSystem.GameObject
Space.Host.ExecutingObject.Collider.IsTrigger = true
--clicking this object toggles it's collider between being a Collider vs Trigger Collider

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.Collider.IsTrigger = not thisObject.Collider.IsTrigger

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
theGameObject = Space.Host.ExecutingObject.Collider.GameObject
Space.Host.ExecutingObject.EventCalendar.ChangeRange(3)
Space.Host.ExecutingObject.EventCalendar.Range = 3
theGameObject = Space.Host.ExecutingObject.EventCalendar.GameObject
Space.Host.ExecutingObject.Furniture.StoreCustomData("AKey", "AValue")
theValue = Space.Host.ExecutingObject.Furniture.GetCustomData("AKey")
inventoryID = Space.Host.ExecutingObject.Furniture.InventoryItemID
sRoomFloor = Space.Host.ExecutingObject.Furniture.Floor
collider = Space.Host.ExecutingObject.Furniture.MainCollider
theGameObject = Space.Host.ExecutingObject.Furniture.GameObject
Space.Host.ExecutingObject.Director.Play()
Space.Host.ExecutingObject.Director.Stop()
Space.Host.ExecutingObject.Director.Pause()
Space.Host.ExecutingObject.Director.Resume()
intState = Space.Host.ExecutingObject.Director.State
Space.Host.ExecutingObject.Director.Time = 10
Space.Host.ExecutingObject.Director.Time = 2
duration = Space.Host.ExecutingObject.Director.Duration
theGameObject = Space.Host.ExecutingObject.Director.GameObject
Space.Host.ExecutingObject.PostProcessVolume.IsGlobal = true
Space.Host.ExecutingObject.PostProcessVolume.BlendDistance = 0
Space.Host.ExecutingObject.PostProcessVolume.Weight = 1
Space.Host.ExecutingObject.PostProcessVolume.Priority = 100
theGameObject = Space.Host.ExecutingObject.PostProcessVolume.GameObject
Space.Host.ExecutingObject.Floor.Name
floorDescription = Space.Host.ExecutingObject.Floor.Description
isDefault = Space.Host.ExecutingObject.Floor.IsDefaultFloor
furnitureInFloor = Space.Host.ExecutingObject.Floor.Furniture
ownerID = Space.Host.ExecutingObject.Floor.Owner
theGameObject = Space.Host.ExecutingObject.Floor.GameObject
Space.Host.ExecutingObject.Data.GetVariable("variableName")
Space.Host.ExecutingObject.SetVariable("variableName",5,true)
Space.Host.ExecutingObject.Data.Enabled = false
--clicking this object will Enable/Disable it's Scripting Data component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Data

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
variableNames = Space.Host.ExecutingObject.Data.Variables
componentName = Space.Host.ExecutingObject.Data.ComponentName
theGameObject = Space.Host.ExecutingObject.Data.GameObject
IsRootCanvas = Space.Host.ExecutingObject.UICanvas.IsRootCanvas
Space.Host.ExecutingObject.UICanvas.ScaleFactor =  2.0
Space.Host.ExecutingObject.UICanvas.ReferencePixelsPerUnit =  50.0
Space.Host.ExecutingObject.UICanvas.PixelPerfect =  true
Space.Host.ExecutingObject.UICanvas.PlaneDistance =  2.0
Space.Host.ExecutingObject.UICanvas.SortingOrder =  2.0
Space.Host.ExecutingObject.UICanvas.TargetDisplay =  1
Space.Host.ExecutingObject.UICanvas.NormalizedSortingGridSize = 5.0
theGameObject = Space.Host.ExecutingObject.UICanvas.GameObject
Enabled
Target
Position
MinPosition
MaxPosition
Rotation
MinRotation
MaxRotation
Scale
MinScale
MaxScale
(OnClick)
Enabled
IsTrigger
GameObject
SwitchEventType
ChangeRange
Range
GameObject
StoreCustomData
GetCustomData
InventoryItemID
Floor
MainCollider
GameObject
Play
Stop
Pause
Resume
State
Time
InitialTime
Duration
GameObject
thisGameObject.Clickable.OnClick(OnClick)
Enabled
IsGlobal
BlendDistance
Weight
Priority
GameObject
Enabled
Name
Description
IsDefaultFloor
Furniture
Owner
GameObject
GetVariable
SetVariable
Enabled
Variables
ComponentName
GameObject
IsRootCanvas
ScaleFactor
ReferencePixelsPerUnit
PixelPerfect
PlaneDistance
SortingOrder
TargetDisplay
NormalizedSortingGridSize
GameObject

SUIRaycastResult Raycast ()

int SortOrderPriority get

int RenderOrderPriority get

SGameObject GameObject get

SUIRaycastResult
SGameObject
raycastResult = Space.Host.ExecutingObject.GraphicRaycaster.Raycast()
local trans = Space.Host.ExecutingObject
local canvas = Space.Host.GetReference("Canvas")
local gr = canvas.GraphicRaycaster
function Update()
    local raycast = gr.Raycast()
    Space.Log(raycast.ToString())
end
trans.OnUpdate(Update)

bool CarveOnlyStationary get set

bool Carving get set

SVector Center get set

float Height get set

SVector Size get set

float Radius get set

int Shape get set

float MoveThreshold get set

float TimeToStationary get set

SGameObject GameObject get

SGameObject

void SendEvent (string eventName)

void ReceiveEvent (string eventName)

bool Enabled get set

bool Instanced get

string NetworkName get set

bool Ready get

int EventCount get

string[] EventNames get

SGameObject GameObject get

SGameObject

void InvokeEvent (string name)

bool Enabled get set

string[] Events get

string ComponentName get

SGameObject GameObject get

SGameObject
Space.Host.ExecutingObject.Events.InvokeEvent("EventName")

SVector Center get set

float Radius get set

bool Enabled get set

bool IsTrigger get set

SGameObject GameObject get

SVector
SGameObject
Center = Space.Host.ExecutingObject.SphereCollider.Center
--clicking this object moves it's Sphere Collider's center one unit upwards

thisObject = Space.Host.ExecutingObject

OnClick = function()
center = thisObject.SphereCollider.Center

thisObject.SphereCollider.Center = Vector.New(center.X,center.Y + 1, center.Z)

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.GraphicRaycaster.SortOrderPriority= 1
Space.Host.ExecutingObject.GraphicRaycaster.RenderOrderPriority = 1
theGameObject = Space.Host.ExecutingObject.GraphicRaycaster.GameObject
Space.Host.ExecutingObject.NavMeshObstacle.CarveOnlyStationary = true
Space.Host.ExecutingObject.NavMeshObstacle.Carving = true
Space.Host.ExecutingObject.NavMeshObstacle.Center = Vector.New(0,0,0)
Space.Host.ExecutingObject.NavMeshObstacle.Height = 40
Space.Host.ExecutingObject.NavMeshObstacle.Size = Vector.New(5,10,15)
Space.Host.ExecutingObject.NavMeshObstacle.Radius = 10
Space.Host.ExecutingObject.NavMeshObstacle.Shape = 1
Space.Host.ExecutingObject.NavMeshObstacle.MoveThreshold = 5
Space.Host.ExecutingObject.NavMeshObstacle.TimeToStationary = 5.0
theGameObject = Space.Host.ExecutingObject.NavMeshObstacle.GameObject
Space.Host.ExecutingObject.Networking.SendEvent("Light On")
Space.Host.ExecutingObject.Networking.ReceiveEvent("Light On")
Space.Host.ExecutingObject.Networking.Enabled = true
isInstanced = Space.Host.ExecutingObject.Networking.Instanced
Space.Host.ExecutingObject.Networking.NetworkName = "Example Network Name 1"
isReady = Space.Host.ExecutingObject.Networking.Ready
count = Space.Host.ExecutingObject.Networking.EventCount
tableOfNames = Space.Host.ExecutingObject.Networking.EventNames
theGameObject = Space.Host.ExecutingObject.Networking.GameObject
Space.Host.ExecutingObject.Events.Enabled = true
eventNames = Space.Host.ExecutingObject.Events.Events
componentName = Space.Host.ExecutingObject.Events.ComponentName
theGameObject = Space.Host.ExecutingObject.Events.GameObject
Space.Host.ExecutingObject.SphereCollider.Radius = 2
--clicking this object increments it's Sphere Collider's radius by one unit 

thisObject = Space.Host.ExecutingObject

OnClick = function()

thisObject.SphereCollider.Radius = thisObject.SphereCollider.Radius + 1

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.SphereCollider.Enabled = false
--clicking this object toggles it's Sphere Collider On/Off

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.SphereCollider.Enabled = not thisObject.SphereCollider.Enabled

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.SphereCollider.Enabled = true
--clicking this object toggles it's Sphere Collider between being a Collider vs Trigger Collider

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.SphereCollider.IsTrigger = not thisObject.SphereCollider.IsTrigger

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
theGameObject = Space.Host.ExecutingObject.SphereCollider.GameObject

float get set

float get set

bool get set

bool get set

SVector get set

float get set

SVector get set

float get set

bool get set

SGameObject get

Properties

BendingStiffness

float BendingStiffness get set

Bending stiffness of cloth.

CollisionMassScale

float CollisionMassScale get set

Increase the mass of colliding particles.

EnableContinuousCollision

bool EnableContinuousCollision get set

Enable continuous collision to improve collision stability.

Enabled

bool Enabled get set

Enable or disable components.

ExternalAcceleration

SVector ExternalAcceleration get set

A constant external acceleration applied to the cloth.

Friction

float Friction get set

Return the friction of the cloth when colliding with the character.

RandomAcceleration

SVector RandomAcceleration get set

A constant external acceleration applied to the cloth.

StretchingStiffness

float StretchingStiffness get set

Stretching stiffness of the cloth.

UseGravity

bool UseGravity get set

Stretching stiffness of the cloth.

GameObject

SGameObject GameObject get

Property Description

void (Closure callback)

Properties Index

Property Name

float get set

float get set

int get set

SColor get set

SColor get set

SColor get set

SColor get set

float get set

SGameObject get

OnValueChanged

void OnValueChanged (Closure callback)

Handling for when the scrollbar value is changed.

Parameter
Type
Description

Properties

Size

float Size get set

The size of the scrollbar handle where 1 means it fills the entire scrollbar.

Value

float Value get set

The current value of the scrollbar, between 0 and 1.

NumberOfSteps

int NumberOfSteps get set

Property Description

NormalColor

SColor NormalColor get set

Property Description

HighlightedColor

SColor HighlightedColor get set

Property Description

PressedColor

SColor PressedColor get set

Property Description

DisabledColor

SColor DisabledColor get set

Property Description

ColorMultiplier

float ColorMultiplier get set

Property Description

GameObject

SGameObject GameObject get

Property Description

SAudioReactiveTransform

Index

Properties Index

Property Name

Properties

Enabled

bool Enabled get set

Whether the Audio Reactive Transform component is enabled or not.

Target

Target get set

The target GameObject which will be affected by the Audio Reactive Transform.

Position

bool Position get set

Whether or not the target's position will be affected by the Audio Reactive Transform.

MinPosition

MinPosition get set

Returns MinPosition value of the Audio Reactive Transform.

MaxPosition

MaxPosition get set

Returns MaxPosition value of the Audio Reactive Transform.

Rotation

bool Rotation get set

Whether or not the target's rotation will be affected by the Audio Reactive Transform.

MinRotation

MinRotation get set

Returns MinRotation value of the Audio Reactive Transform.

MaxRotation

MaxRotation get set

Returns MaxRotation value of the Audio Reactive Transform.

Scale

bool Scale get set

Whether or not the target's scale will be affected by the Audio Reactive Transform.

MinScale

MinScale get set

Returns MinScale value of the Audio Reactive Transform.

MaxScale

MaxScale get set

Returns MaxScale value of the Audio Reactive Transform.

GameObject

GameObject get

Returns a reference to the GameObject of this component.

SCapsuleCollider

Index

Properties Index

Property Name

Properties

Center

Center get set

The center of the capsule, measured in the object's local space.

Direction

int Direction get set

The direction of the capsule.

Height

float Height get set

The height of the capsule measured in the object's local space.

Radius

float Radius get set

The radius of the capsule.

Enabled

bool Enabled get set

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

IsTrigger

bool IsTrigger get set

Is the collider a trigger?

GameObject

GameObject get

Returns a reference to the GameObject of this component.

SClickable

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

AddExtraAction

void AddExtraAction (string name, string tooltip, Closure e)

Add a new action for the object to perform when clicked. Can be useful for providing miltuple choice of an action on click.

Parameter
Type
Description

ClearActions

void ClearActions ()

Removes all actions from the clickable GameObject.

OnClick

void OnClick (Closure e)

When clicked, the GameObject performs the required action.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Enable or disable the clickable component from a GameObject.

Tooltip

string Tooltip get set

A hint that pops up when the mouse is hovering over the GameObject.

GameObject

SGameObject GameObject get

Returns a reference to the GameObject of this component.

SModularVehicle

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

ForceSetOwner

void ForceSetOwner (int newOwner, int vehicleId)

Force player of the id owned this vehicle, but only between this spawned vehicle. But it seems the new owner can’t drive on this vehicle.

Parameter
Type
Description

ForceActivate

void ForceActivate ()

Force player drive on this vehicle

ForceDeactivate

void ForceDeactivate ()

Force player out of the vehicle.

SuppressTimeout

void SuppressTimeout ()

Disable the vehicle automatic respawn

OverrideOnClick

void OverrideOnClick (Closure onClick)

Add onClick method to this vehicle,onClick have to be a closure.

Parameter
Type
Description

Properties

VerticalInput

float VerticalInput get set

Force vertical offset value, it would be added to vertical control and never set to zero.

HorizontalInput

float HorizontalInput get set

Force horizontal offset value, it would be added to horizontal control and never set to zero.

StrafeInput

float StrafeInput get set

Force strafe offset value,it would be added to strafe control and never set to zero.

DepthInput

float DepthInput get set

Force depth offset value, it would be added to depth control and never set to zero.

IgnoreUserInput

bool IgnoreUserInput get set

If this option is enabled, user input would be ignored until disable this.

Driver

Driver get

Get the player avatar component.

GameObject

GameObject get

Returns the GameObject of this Vehicle component.

SScriptingRuntime

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

GetResource

GetResource (string name)

Get the resource by its name and return it.

Parameter
Type
Description

CallScriptFunction

void CallScriptFunction (string name, params DynValue[] arguments) void CallScriptFunction (string name)

Call registered script function with specified arguments.

Parameter
Type
Description

Reset

void Reset ()

Reset event members to their initial values.

GetPublicVariable

object GetPublicVariable (string name)

Gets the public variable by its name and return it.

Parameter
Type
Description

SetPublicVariable

void SetPublicVariable (string name, DynValue property, bool persistent=false)

Set the property to public variable with name "name".

Parameter
Type
Description

InvokeEvent

void InvokeEvent (string name)

Invokes the event with the name "name".

Parameter
Type
Description

Properties

Resources

[] Resources get

Return a list of resource.

Enabled

bool Enabled get set

Whether the scripting runtime component is Enabled.

ComponentName

string ComponentName get

The name of this component.

GameObject

GameObject get

Property Description

SVirtualCamera

Index

Properties Index

Property Name

Properties

Enabled

bool Enabled get set

Is this virtual camera enabled?

FieldOfView

float FieldOfView get set

Field of view of this virtual camera.

Dutch

float Dutch get set

Dutch of view of this virtual camera. In degrees.

NearClip

float NearClip get set

The near clip plane of this virtual camera.

FarClip

float FarClip get set

The far clip plane of this virtual camera.

OrthographicSize

float OrthographicSize get set

The orthographic size of this virtual camera.

Priority

int Priority get set

The priority of this virtual camera. Higher priority cameras will be used over lower priority cameras when conflicted.

Follow

Follow get set

The object that this virtual camera should be following.

LookAt

LookAt get set

The object that this virtual camera should be looking at.

GameObject

GameObject get

Property Description

SUIRawImage

Index

Properties Index

Property Name

Properties

RaycastTarget

bool RaycastTarget get set

Enable Raycast Target.

Maskable

bool Maskable get set

To check if the graphic is maskable.

Texture

Texture get set

The RawImage's texture.

Color

Color get set

Base color of the Graphic.

GameObject

GameObject get

Property Description

SAudioReactiveBase

Index

Properties Index

SLight

Index

Properties Index

Property Name

SStateMachine

Index

Functions Index

Function Name

SUIButton

Index

Functions Index

Function Name
Space.Host.ExecutingObject.Cloth.BendingStiffness = 0.5
Space.Host.ExecutingObject.Cloth.CollisionMassScale = 0.5
Space.Host.ExecutingObject.Cloth.EnableContinuousCollision = true
Space.Host.ExecutingObject.Cloth.Enabled = false
--clicking this object will Enable/Disable it's Cloth component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Cloth

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Cloth.ExternalAcceleration = Vector.New(2,4,5)
Space.Host.ExecutingObject.Cloth.Friction = 0.8
Space.Host.ExecutingObject.Cloth.RandomAcceleration = Vector.New(2,4,5)
Space.Host.ExecutingObject.Cloth.StretchingStiffness = 0.6
Space.Host.ExecutingObject.Cloth.UseGravity = true
theGameObject = Space.Host.ExecutingObject.Cloth.GameObject
function OCV()
--
end
Space.Host.ExecutingObject.UIScrollbar.OnValueChanged(OCV)
Space.Host.ExecutingObject.UIScrollbar.Size = 0.1
Space.Host.ExecutingObject.UIScrollbar.Value = 0.5
Space.Host.ExecutingObject.UIScrollbar.NumberOfSteps = 2
Space.Host.ExecutingObject.UIScrollbar.NormalColor = Color.Red
Space.Host.ExecutingObject.UIScrollbar.HighlightedColor = Color.Red
Space.Host.ExecutingObject.UIScrollbar.PressedColor = Color.Red
Space.Host.ExecutingObject.UIScrollbar.DisabledColor = Color.Red
Space.Host.ExecutingObject.UIScrollbar.ColorMultiplier = Color.Red
theGameObject = Space.Host.ExecutingObject.UIScrollbar.GameObject
BendingStiffness
CollisionMassScale
EnableContinuousCollision
Enabled
ExternalAcceleration
Friction
RandomAcceleration
StretchingStiffness
UseGravity
GameObject
OnValueChanged
Size
Value
NumberOfSteps
NormalColor
HighlightedColor
PressedColor
DisabledColor
ColorMultiplier
GameObject

bool Enabled get set

SGameObject Target get set

bool Position get set

SVector MinPosition get set

SVector MaxPosition get set

bool Rotation get set

SVector MinRotation get set

SVector MaxRotation get set

bool Scale get set

SVector MinScale get set

SVector MaxScale get set

SGameObject
SVector
SVector
SVector
SVector
SVector
SVector
SGameObject

SVector Center get set

int Direction get set

float Height get set

float Radius get set

bool Enabled get set

bool IsTrigger get set

SVector
SGameObject
Center = Space.Host.ExecutingObject.CapsuleCollider.Center
--clicking this object moves it's Capsule Collider's center one unit upwards

thisObject = Space.Host.ExecutingObject

OnClick = function()
center = thisObject.CapsuleCollider.Center

thisObject.CapsuleCollider.Center = Vector.New(center.X,center.Y + 1, center.Z)

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)

void AddExtraAction (string name, string tooltip, Closure e)

void ClearActions ()

void OnClick (Closure e)

bool Enabled get set

string Tooltip get set

SGameObject GameObject get

void ForceSetOwner (int newOwner, int vehicleId)

void ForceActivate ()

void ForceDeactivate ()

void SuppressTimeout ()

void OverrideOnClick (Closure onClick)

float VerticalInput get set

float HorizontalInput get set

float StrafeInput get set

float DepthInput get set

bool IgnoreUserInput get set

SAvatar Driver get

SGameObject GameObject get

SAvatar
SGameObject

SResource GetResource (string name)

void CallScriptFunction (string name, params DynValue[] arguments) void CallScriptFunction (string name)

void Reset ()

object GetPublicVariable (string name)

void SetPublicVariable (string name, DynValue property, bool persistent=false)

void InvokeEvent (string name)

SResource[] Resources get

bool Enabled get set

string ComponentName get

SGameObject GameObject get

SResource
SResource
SGameObject

bool Enabled get set

float FieldOfView get set

float Dutch get set

float NearClip get set

float FarClip get set

float OrthographicSize get set

int Priority get set

SGameObject Follow get set

SGameObject LookAt get set

SGameObject GameObject get

SGameObject
SGameObject
SGameObject

bool RaycastTarget get set

bool Maskable get set

SResource Texture get set

SColor Color get set

SGameObject GameObject get

SResource
SColor
SGameObject
Space.Host.ExecutingObject.UIRawImage.RaycastTarget = true
Space.Host.ExecutingObject.AudioReactiveTransform.Enabled= false
--clicking this object will Enable/Disable it's Audio Reactive Transform component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveTransform


OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
target = Space.Host.ExecutingObject.AudioReactiveTransform.Target
--clicking this object will toggle between two different Audio Reactive Transform targets
thisObject = Space.Host.ExecutingObject
target1 = Space.Host.GetReference("theTarget1") --add this reference to Scripting Runtime component
target2 = Space.Host.GetReference("theTarget2") --add this reference to Scripting Runtime component

function OnClickFunction()
  if thisObject.AudioReactiveTransform.Target == target1 then
    thisObject.AudioReactiveTransform.Target = target2
  else
    thisObject.AudioReactiveTransform.Target = target1
  end
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.AudioReactiveTransform.Position = true
--clicking this object will toggle it's Audio Reactive Transform Position property 
thisObject = Space.Host.ExecutingObject

function OnClickFunction()
   thisObject.AudioReactiveTransform.Position = not thisObject.AudioReactiveTransform.Position
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.AudioReactiveTransform.MinPosition = Vector.New(0,1,0)
Space.Host.ExecutingObject.AudioReactiveTransform.MaxPosition = Vector.New(1,2,1)
Space.Host.ExecutingObject.AudioReactiveTransform.Rotation= true
--clicking this object will toggle it's Audio Reactive Transform Rotation property 
thisObject = Space.Host.ExecutingObject

function OnClickFunction()
   thisObject.AudioReactiveTransform.Rotation= not thisObject.AudioReactiveTransform.Rotation
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.AudioReactiveTransform.MinRotation = Vector.New(0,30,0)
Space.Host.ExecutingObject.AudioReactiveTransform.MinRotation = Vector.New(0,60,0)
Space.Host.ExecutingObject.AudioReactiveTransform.Scale= true
--clicking this object will toggle it's Audio Reactive Transform Scale property 
thisObject = Space.Host.ExecutingObject

function OnClickFunction()
   thisObject.AudioReactiveTransform.Scale= not thisObject.AudioReactiveTransform.Scale
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.AudioReactiveTransform.MinScale = Vector.New(1,1,1)
Space.Host.ExecutingObject.AudioReactiveTransform.MaxScale = Vector.New(2,2,2)
theGameObject = Space.Host.ExecutingObject.AudioReactiveTransform.GameObject
 Direction = Space.Host.ExecutingObject.CapsuleCollider.Direction 
--clicking this object increases it's Capsule Collider's direction by one unit

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.CapsuleCollider.Direction

thisObject.CapsuleCollider.Direction = thisObject.CapsuleCollider.Direction + 1

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.CapsuleCollider.Height = 5.0
--clicking this object increases it's Capsule Collider's height by one unit

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.CapsuleCollider.Height

thisObject.CapsuleCollider.Height= thisObject.CapsuleCollider.Height+ 1.0

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Radius = Space.Host.ExecutingObject.CapsuleCollider.Radius
--clicking this object increments it's Capsule Collider's radius by one unit 

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.CapsuleCollider.Radius = thisObject.CapsuleCollider.Radius + 1

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.CapsuleCollider.Enabled = false
--clicking this object toggles it's Capsule Collider On/Off

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.CapsuleCollider.Enabled = not thisObject.CapsuleCollider.Enabled

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.CapsuleCollider.IsTrigger = false
--clicking this object toggles it's Capsule Collider between being a Collider vs Trigger Collider

thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.CapsuleCollider.IsTrigger = not thisObject.CapsuleCollider.IsTrigger

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
theGameObject = Space.Host.ExecutingObject.CapsuleCollider.GameObject
Space.Host.ExecutingObject.Clickable.AddExtraAction ("ButtonName", "Tooltip Text Here", AFunction)
Space.Host.ExecutingObject.Clickable.ClearActions()
hostObject = Space.Host.ExecutingObject
hostObject.AddClickable()

function ClickMe ()
Space.Log("I was clicked!")
end
function ClickAndClear ()
Space.Log("No more actions!")
hostObject.Clickable.ClearActions ()
end

hostObject.Clickable.AddExtraAction ("LogButton", "Prints I was clicked! to the console", ClickMe)
hostObject.Clickable.AddExtraAction ("ClearButton", "Clears all actions", ClickAndClear)
-- Now, when the latter option is chosen, the script clears the Clickable component of all actions.
Space.Host.ExecutingObject.Clickable.OnClick(AFunction)
hostObject = Space.Host.ExecutingObject
hostObject.AddClickable()
deltaPos = Vector.New(0,0,1)

function MakeMeMove ()
hostObject.WorldPosition = hostObject.WorldPosition + deltaPos
end

hostObject.Clickable.OnClick (MakeMeMove);
-- Now, every time an object is clicked, it moves by 1 in the positive Z direction.
Space.Host.ExecutingObject.Clickable.Enabled = false
--Clicking the object will disable the component, making it only clickable once
thisGameObject = Space.Host.ExecutingObject


OnClick = function()
 thisGameObject.Clickable.Enabled = false
end


thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to activate"
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Clickable.Tooltip = "test"
--Clicking the object will toggle between two different tooltips
thisGameObject = Space.Host.ExecutingObject


OnClick = function()
  if thisGameObject.Clickable.Tooltip == "Turn On" then
    thisGameObject.Clickable.Tooltip = "Turn Off"
  else
    thisGameObject.Clickable.Tooltip = "Turn On"
  end
end


thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Turn On"
thisGameObject.Clickable.OnClick(OnClick)
theGameObject = Space.Host.ExecutingObject.Clickable.GameObject
Space.Host.ExecutingObject.Vehicle.ForceSetOwner(AvatarID)
Space.Host.ExecutingObject.Vehicle.ForceActivate()
Space.Host.ExecutingObject.Vehicle.ForceDeactivate()
Space.Host.ExecutingObject.Vehicle.SuppressTimeout()
Space.Host.ExecutingObject.Vehicle.OverrideOnClick(NewOnClickFunction)
Space.Host.ExecutingObject.Vehicle.VerticalInput = 0.5
Space.Host.ExecutingObject.Vehicle.HorizontalInput = 0.5
Space.Host.ExecutingObject.Vehicle.StrafeInput = 0.5
Space.Host.ExecutingObject.Vehicle.DepthInput = 0.5
Space.Host.ExecutingObject.Vehicle.IgnoreUserInput = true
DriverAvatar = Space.Host.ExecutingObject.Vehicle.Driver
VehicleGameObject = Space.Host.ExecutingObject.Vehicle.GameObject
resource = Space.Host.ExecutingObject.Script.GetResource("resource name")
resource = Space.Host.ExecutingObject.Script.CallScriptFunction("FunctionName")
--or
resource = Space.Host.ExecutingObject.Script.CallScriptFunction("FunctionName", tableWithArguments)
Space.Host.ExecutingObject.Script.Reset()
publicVariable = Space.Host.ExecutingObject.Script.GetPublicVariable("variableName")
Space.Host.ExecutingObject.Script.SetPublicVariable("VariableName",5,true)
Space.Host.ExecutingObject.Script.InvokeEvent("EventName")
tableResources = Space.Host.ExecutingObject.Script.Resources
Space.Host.ExecutingObject.Script.Enabled = true
componentName = Space.Host.ExecutingObject.Script.ComponentName
theGameObject = Space.Host.ExecutingObject.Script.GameObject
Space.Host.ExecutingObject.VirtualCamera.Enabled = true
--clicking this object will Enable/Disable it's Virtual Camera component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.VirtualCamera

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.VirtualCamera.FieldOfView = 50.0
Space.Host.ExecutingObject.VirtualCamera.Dutch = 50.0
Space.Host.ExecutingObject.VirtualCamera.NearClip = 50.0
Space.Host.ExecutingObject.VirtualCamera.FarClip = 50.0
Space.Host.ExecutingObject.VirtualCamera.OrthographicSize = 10.0
Space.Host.ExecutingObject.VirtualCamera.Priority = 500
AReferenceToGameObject = Space.Host.GetReference("Reference Name")
Space.Host.ExecutingObject.VirtualCamera.Follow = AReferenceToGameObject
AReferenceToGameObject = Space.Host.GetReference("Reference Name")
Space.Host.ExecutingObject.VirtualCamera.LookAt = AReferenceToGameObject
theGameObject = Space.Host.ExecutingObject.VirtualCamera.GameObject
Space.Host.ExecutingObject.UIRawImage.Maskable = true
Space.Host.ExecutingObject.UIRawImage.Texture = Space.GetResource("Resource Name")
Space.Host.ExecutingObject.UIRawImage.Color = Color.Red
theGameObject = Space.Host.ExecutingObject.UIRawImage.GameObject 
Property Name

bool get set

int get set

int get set

float get set

float get set

float get set

float get set

float get set

int get set

virtual float get

Properties

Enabled

bool Enabled get set

Whether the Audio Reactive component is enabled or not.

BandMin

int BandMin get set

The Band Min property of an Audio Reactive component.

BandMax

int BandMax get set

The Band Max property of an Audio Reactive component.

BPMWindow

float BPMWindow get set

The BPM Window property of an Audio Reactive component.

LimitIncrease

float LimitIncrease get set

The Limit Increase property of an Audio Reactive component.

LimitDecrease

float LimitDecrease get set

The Limit Decrease property of an Audio Reactive component.

MinValue

float MinValue get set

The Min Value property of an Audio Reactive component.

MaxValue

float MaxValue get set

The Max Value property of an Audio Reactive component.

Mode

int Mode get set

The Mode property of an Audio Reactive component. Band is 0, and BMP is 1.

Power

float Power get

Property Description

GameObject

SGameObject GameObject get

Returns a reference to the GameObject of this component.

bool get set

float get set

float get set

float get set

SVector get set

SLightType get set

SGameObject get

Properties

Enabled

bool Enabled get set

Enable/Disable this light.

Space.Host.ExecutingObject.Light.Enabled = false
--the below script will make the object Enable/Disable it's Light component
--[Add "light" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
light = Space.Host.GetReference("light").Light


OnClick = function()
light.Enabled =  not light.Enabled

Range

float Range get set

Get/Set the effective range of the light source.

SpotAngle

float SpotAngle get set

The angle of the light's spotlight cone in degrees.

Intensity

float Intensity get set

Property Description

Color

SVector Color get set

Get/Set the color of the light.

Type

int Type get set

Get/Set the type of light this source is. 0 = Directional, 1 = Point, 2 = Spot, 3 = Area.

GameObject

SGameObject GameObject get

Property Description

void ()

void ()

void (int state) void (string state)

void () void (SGameObject go)

Properties Index

Property Name

bool get set

int get

string[] get

int get

string get

string get

SGameObject get

Functions

NextState

void NextState ()

Enter the next state

PrevState

void PrevState ()

SetState

void SetState (int state) void SetState (string state)

Enters the state of being set that its order is "state"

Parameter
Type
Description

state

int

The index of the state. First state is 1.

state

string

The name of the state as set in the State Machine component.

BindToUI

void BindToUI () void BindToUI (SGameObject go)

The state machine will bind itself to all Toggles, Buttons, Dropdowns and Sliders on the SGameObject it is in or on a specified SGameObject.

Binding to Button : Clicking button will call NextState() Binding to Toggle: Toggle On sets State to 1, Toggle Off sets state to 2 Binding to Dropdown: Selecting will set State to that selection's caption text Binding to Slider: Moving slider changes State to slider value

Parameter
Type
Description

go

SGameObject

A specific SGameObject which this State Machine will bind to.

Properties

Enabled

bool Enabled get set

Whether the simple state machine component is Enabled or not

StateCount

int StateCount get

Total number of States.

StateNames

string[] StateNames get

A list of the names of all States.

CurrentState

int CurrentState get

The index number of the current state.

CurrentStateName

string CurrentStateName get

The name of the current state, or null if no state.

ComponentName

string ComponentName get

The name of this component.

GameObject

SGameObject GameObject get

The GameObject this component is attached to. A component is always attached to a GameObject.

void (Closure callback)

Properties Index

Property Name

bool get set

bool get set

SColor get set

SColor get set

SColor get set

SColor get set

float get set

SGameObject get

Functions

OnClick

void OnClick (Closure callback)

Invoke when a user clicks the button and releases it.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether the button component is Enabled.

Interactable

bool Interactable get set

Enable Interactable if you want this button to accept input.

NormalColor

SColor NormalColor get set

The normal color of the control.

HighlightedColor

SColor HighlightedColor get set

The color of the control when it is highlighted.

PressedColor

SColor PressedColor get set

The color of the control when it is pressed.

DisabledColor

SColor DisabledColor get set

The color of the control when it is disabled.

ColorMultiplier

float ColorMultiplier get set

This multiplies the tint color for each transition by its value. With this you can create colors greater than 1 to brighten the colors on graphic elements whose base color is less than white.

GameObject

SGameObject GameObject get

Property Description

SCamera

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

TakePhoto

void TakePhoto ()

Triggers the Photo window in the UI, with the output of this camera. Perfect for photo booths.

TakeSnapshot

TakeSnapshot ()

Captures a texture from the camera, and saves it in a SResource

Properties

HDR

bool HDR get set

Can this camera write HDR values? (i.e. values brighter than 1.0)

PixelWidth

int PixelWidth get

The width of this Camera's texture, in pixels

PixelHeight

int PixelHeight get

The height of this Camera's texture in pixels

Velocity

Velocity get

World space speed of this camera, typically used for motion blur.

UseOcclusionCulling

bool UseOcclusionCulling get set

Is Occlusion Culling enabled on this camera?

Enabled

bool Enabled get set

Is this camera enabled?

FieldOfView

float FieldOfView get set

The field of view of the camera, in typical scenarios, Sinespace uses a value of 52; however Unity will default to 60.

Orthographic

bool Orthographic get set

Does this camera render without perspective?

OrthographicSize

float OrthographicSize get set

The width of the camera when in Orthographic mode. Height will be adjusted based on aspect ratio of the Render Texture

NearClip

float NearClip get set

How close can an object be to the camera plane before it is not rendered?

FarClip

float FarClip get set

How far is an object from the camera plane before it is not rendered?

GameObject

GameObject get

Returns a reference to the GameObject of this component.

SRectTransform

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

SetParent

void SetParent ( parent, bool worldPositionStays)

Set the parent of the transform.

Parameter
Type
Description

SetInsetAndSizeFromParentEdge

void SetInsetAndSizeFromParentEdge (int edge, float inset, float size)

Set the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size.

Parameter
Type
Description

SetSizeWithCurrentAnchors

void SetSizeWithCurrentAnchors (bool vertical, float size)

Makes the RectTransform calculated rect be a given size on the specified axis.

Parameter
Type
Description

Properties

Rect

Rect get

Property Description

anchorMin

anchorMin get set

The normalized position in the parent RectTransform that the lower left corner is anchored to.

anchorMax

anchorMax get set

Property Description

anchoredPosition3D

anchoredPosition3D get set

Property Description

anchoredPosition

anchoredPosition get set

Property Description

sizeDelta

sizeDelta get set

The size of this RectTransform relative to the distances between the anchors.

pivot

pivot get set

The normalized position in this RectTransform that it rotates around.

offsetMin

offsetMin get set

The offset of the lower left corner of the rectangle relative to the lower left anchor.

offsetMax

offsetMax get set

The offset of the upper right corner of the rectangle relative to the upper right anchor.

GameObject

GameObject get

Property Description

SSkinnedMeshRenderer

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

GetBlendShapeWeight

float GetBlendShapeWeight (int index)

Return the value of BlendShapeWeight.

Parameter
Type
Description

SetBlendShapeWeight

void SetBlendShapeWeight (int index, float value)

Set the value to the BlendShapeWeight.

Parameter
Type
Description

Properties

Mesh

Mesh get set

Return the mesh.

IsVisible

bool IsVisible get

Property Description

Enabled

bool Enabled get set

To check if the SkinnedMeshRenderer component is Enabled or not.

Material

Material get set

Property Description

SharedMaterial

SharedMaterial get set

Property Description

Materials

[] Materials get set

Property Description

SharedMaterials

[] SharedMaterials get set

Property Description

BoundsMax

BoundsMax get

Property Description

BoundsMin

BoundsMin get

Property Description

GameObject

GameObject get

Property Description

SMeshRenderer

Index

Properties Index

Property Name

SRenderer

Index

Properties Index

Property Name

STerrain

Index

Functions Index

Function Name

SUILayout

Index

Properties Index

Property Name

SUIToggle

Index

Functions Index

Function Name
Space.Host.ExecutingObject.AudioReactive.Enabled = false
--clicking this object will Enable/Disable it's Audio Reactive Base component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactive


OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactive.BandMin= 1
--the below script will make a slider change an Audio Reactive Component's Band Min property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.BandMin = (slider.Value * 12.0) -- from 0 to 12
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactive.BandMax= 11
--the below script will make a slider change an Audio Reactive Component's Band Max property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.BandMax = (slider.Value * 12.0) -- from 0 to 12
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactive.BPMWindow= 5
--the below script will make a slider change an Audio Reactive Component's BPM Window property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.BPMWindow = (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactive.LimitIncrease= 1
--the below script will make a slider change an Audio Reactive Component's Limit Increase property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.LimitIncrease= (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactive.LimitDecrease= 3
--the below script will make a slider change an Audio Reactive Component's Limit Decrease property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.LimitDecrease= (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactive.MinValue= 1
--the below script will make a slider change an Audio Reactive Component's Min Value property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.MinValue= (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactive.MaxValue= 3
--the below script will make a slider change an Audio Reactive Component's Max Value property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.MaxValue= (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactive.Mode= 1
--clicking this object will toggle between it's two Audio Reactive Modes

thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactive


OnClick = function()
  if component.Mode == 0 then
    component.Mode = 1
  else
    component.Mode = 0
  end
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactive.Power = 1
theGameObject = Space.Host.ExecutingObject.AudioReactive.GameObject
Space.Host.ExecutingObject.Light.Range = 8.0
--the below script will make a slider set the Light's range
--[Add "slider" and "light" references to the Scripting Runtime component]

light = Space.Host.GetReference("light").Light
slider = Space.Host.GetReference("slider").UISlider

OVC = function()
light.Range = (slider.Value * 100) --(from 0 to 100)
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.Light.SpotAngle = 50
--the below script will make a slider set the Light's Spot Angle
--[Add "slider" and "light" references to the Scripting Runtime component]

light = Space.Host.GetReference("light").Light
slider = Space.Host.GetReference("slider").UISlider

light.Type = 2 --it has to be Spot type 

OVC = function()
light.SpotAngle = (slider.Value * 178) + 1 --(from 1 to 179)
end

slider.OnValueChanged(OVC)
LightIntensity = Space.Host.ExecutingObject.Light.Intensity
--the below script will make a slider set the Light's Intensity
--[Add "slider" and "light" references to the Scripting Runtime component]

light = Space.Host.GetReference("light").Light
slider = Space.Host.GetReference("slider").UISlider


OVC = function()
light.Intensity = (slider.Value * 8) --(from 0 to 8)
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.Light.Color = Color.Red
--clicking the object will open a color picker that changes Light's color
----[Add "light" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
light = Space.Host.GetReference("light").Light

OnChange = function(SColor) 
 light.Color = SColor
end

OnSelect = function(SColor)
 light.Color = SColor
end

OnCancel = function()
end

OnClick = function()
Space.Dialogues.ColorPicker("Pick a color","Ok", OnChange, OnSelect, OnCancel, Color.Red)
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Light.Type = 0
--Clicking the object toggles between the 4 different light types
--[Add "light" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
light = Space.Host.GetReference("light").Light

OnClick = function()
  
  if light.Type == 3 then
    light.Type = 0
  else light.Type = light.Type + 1
  end
  
end

thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
theGameObject = Space.Host.ExecutingObject.Light.GameObject
Space.Host.ExecutingObject.StateMachine.NextState()
Space.Host.ExecutingObject.StateMachine.PrevState()
Space.Host.ExecutingObject.StateMachine.SetState(2)
--or
Space.Host.ExecutingObject.StateMachine.SetState('A State Name')
Space.Host.ExecutingObject.StateMachine.BindToUI()
----or
Space.Host.ExecutingObject.StateMachine.BindToUI(Space.Host.GetReference("a reference"))
Space.Host.ExecutingObject.StateMachine.Enabled = false
numberOfStates = Space.Host.ExecutingObject.StateMachine.StateCount
tableStateNames = Space.Host.ExecutingObject.StateMachine.StateNames
currentState = Space.Host.ExecutingObject.StateMachine.CurrentState
currentStateName = Space.Host.ExecutingObject.StateMachine.CurrentStateName
componentName = Space.Host.ExecutingObject.StateMachine.ComponentName
theGameObject = Space.Host.ExecutingObject.StateMachine.GameObject
function OnClickFunction()
--
end

Space.Host.ExecutingObject.UIButton.OnClick(OnClickFunction)
Space.Host.ExecutingObject.UIButton.Enabled = true
--clicking this object will toggle Enable/Disable an object's Button component

thisGameObject = Space.Host.ExecutingObject
button = Space.Host.GetReference("button").UIButton 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
button.Enabled =  not button.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UIButton.Interactable = true
--clicking this object will toggle Interactable status on an object's Button component

thisGameObject = Space.Host.ExecutingObject
button = Space.Host.GetReference("button").UIButton 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
button.Interactable=  not button.Interactable
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UIButton.NormalColor = Color.Red
Space.Host.ExecutingObject.UIButton.NormalColor = Color.Red
Space.Host.ExecutingObject.UIButton.PressedColor = Color.Red
Space.Host.ExecutingObject.UIButton.PressedColor = Color.Red
Space.Host.ExecutingObject.UIButton.ColorMultiplier = Color.Red
Space.Host.ExecutingObject.UIButton.GameObject = Color.Red
Enabled
BandMin
BandMax
BPMWindow
LimitIncrease
LimitDecrease
MinValue
MaxValue
Mode
Power
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Enabled
Range
SpotAngle
Intensity
Color
Type
GameObject
NextState
PrevState
SetState
SetState
BindToUI
BindToUI
Enabled
StateCount
StateNames
CurrentState
CurrentStateName
ComponentName
GameObject
OnClick
Enabled
Interactable
NormalColor
HighlightedColor
PressedColor
DisabledColor
ColorMultiplier
GameObject

float GetBlendShapeWeight (int index)

void SetBlendShapeWeight (int index, float value)

SResource Mesh get set

bool IsVisible get

bool Enabled get set

SMaterial Material get set

SMaterial SharedMaterial get set

SMaterial[] Materials get set

SMaterial[] SharedMaterials get set

SVector BoundsMax get

SVector BoundsMin get

SResource
SMaterial
SMaterial
SMaterial
SMaterial
SVector
SVector
SGameObject
Space.Host.ExecutingObject.SkinnedMeshRenderer.GetBlendShapeWeight(0)
Space.Host.ExecutingObject.SkinnedMeshRenderer.SetBlendShapeWeight(0)
Space.Host.ExecutingObject.SkinnedMeshRenderer.Mesh = Space.GetResource("resourceName")
isVisible = Space.Host.ExecutingObject.SkinnedMeshRenderer.IsVisible
Space.Host.ExecutingObject.SkinnedMeshRenderer.Enabled = true
--clicking this object will Enable/Disable an object's SkinnedMeshRenderer component
--[Add "skinnedmeshrenderer" reference to scripting runtime component]
thisGameObject = Space.Host.ExecutingObject
skinnedmeshrenderer = Space.Host.GetReference("skinnedmeshrenderer").SkinnedMeshRenderer


OnClick = function()
skinnedmeshrenderer.Enabled =  not skinnedmeshrenderer.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.SkinnedMeshRenderer.Material = Space.GetResource("ResourceName").AsMaterial
Space.Host.ExecutingObject.SkinnedMeshRenderer.SharedMaterial = Space.GetResource("ResourceName").AsMaterial
Space.Host.ExecutingObject.SkinnedMeshRenderer.Materials = {Space.GetResource("1stResourceName").AsMaterial, Space.GetResource("2ndResourceName").AsMaterial}
Space.Host.ExecutingObject.SkinnedMeshRenderer.SharedMaterials = {Space.GetResource("1stResourceName").AsMaterial, Space.GetResource("2ndResourceName").AsMaterial}
vectorBoundsMax = Space.Host.ExecutingObject.SkinnedMeshRenderer.BoundsMax
vectorBoundsMin = Space.Host.ExecutingObject.SkinnedMeshRenderer.BoundsMin
theGameObject = Space.Host.ExecutingObject.SkinnedMeshRenderer.GameObject

float get set

void TakePhoto ()

SResource TakeSnapshot ()

bool HDR get set

int PixelWidth get

int PixelHeight get

SVector Velocity get

bool UseOcclusionCulling get set

bool Enabled get set

float FieldOfView get set

bool Orthographic get set

float OrthographicSize get set

SResource
SVector
SGameObject

float get set

bool get

bool get set

SMaterial get set

SMaterial get set

SMaterial[] get set

SMaterial[] get set

SVector get

SVector get

Properties

IsVisible

bool IsVisible get

Returns true if the renderer is visible on any camera. Note that the object is considered visible when it needs to be rendered in the Scene. For example, it might not actually be visible by any camera but still need to be rendered for shadows. When running in the editor, the Scene view cameras will also cause this value to be true.

isVisible = Space.Host.ExecutingObject.MeshRenderer.IsVisible

Enabled

bool Enabled get set

Makes the rendered 3D object visible if enabled.

Material

SMaterial Material get set

Returns the first instantiated Material assigned to the renderer.

Modifying material will change the material for this object only.

If the material is used by any other renderers, this will clone the shared material and start using it from now on.

SharedMaterial

SMaterial SharedMaterial get set

The shared material of this object.

Modifying sharedMaterial will change the appearance of all objects using this material, and change material settings that are stored in the project too.

It is not recommended to modify materials returned by sharedMaterial. If you want to modify the material of a renderer use material instead.

Materials

SMaterial[] Materials get set

Returns all the instantiated materials of this object.

This is an array of all materials used by the renderer. Unity supports a single object using multiple materials; in this case materials contains all the materials. sharedMaterial and material properties return the first used material if there is more than one.

Modifying any material in materials will change the appearance of only that object.

Note that like all arrays returned by Unity, this returns a copy of materials array. If you want to change some materials in it, get the value, change an entry and set materials back.

SharedMaterials

SMaterial[] SharedMaterials get set

The shared material of this object.

Modifying sharedMaterial will change the appearance of all objects using this material, and change material settings that are stored in the project too.

It is not recommended to modify materials returned by sharedMaterial. If you want to modify the material of a renderer use material instead.

BoundsMax

SVector BoundsMax get

Property Description

BoundsMin

SVector BoundsMin get

Property Description

bool get

bool get set

SMaterial get set

SMaterial get set

SMaterial[] get set

SMaterial[] get set

SVector get

SVector get

SGameObject get

Properties

IsVisible

bool IsVisible get

Returns true if the renderer is visible on any camera. Note that the object is considered visible when it needs to be rendered in the Scene. For example, it might not actually be visible by any camera but still need to be rendered for shadows. When running in the editor, the Scene view cameras will also cause this value to be true.

Enabled

bool Enabled get set

Get/Set if the rendered object is visible.

Material

SMaterial Material get set

Returns the first instantiated Material assigned to the renderer.

Modifying material will change the material for this object only.

If the material is used by any other renderers, this will clone the shared material and start using it from now on.

SharedMaterial

SMaterial SharedMaterial get set

The shared material of this object.

Modifying sharedMaterial will change the appearance of all objects using this material, and change material settings that are stored in the project too.

It is not recommended to modify materials returned by sharedMaterial. If you want to modify the material of a renderer use material instead.

Materials

SMaterial[] Materials get set

Returns all the instantiated materials of this object.

This is an array of all materials used by the renderer. Unity supports a single object using multiple materials; in this case materials contains all the materials. sharedMaterial and material properties return the first used material if there is more than one.

Modifying any material in materials will change the appearance of only that object.

Note that like all arrays returned by Unity, this returns a copy of materials array. If you want to change some materials in it, get the value, change an entry and set materials back.

SharedMaterials

SMaterial[] SharedMaterials get set

All the shared materials of this object.

This is an array of all materials used by the renderer. Unity supports a single object using multiple materials; in this case sharedMaterials contains all the materials. sharedMaterial and material properties return the first used material if there is more than one.

Modifying any material in sharedMaterials will change the appearance of all objects using this material, and change material settings that are stored in the project too.

It is not recommended to modify materials returned by sharedMaterials. If you want to modify the material of a renderer use material instead.

Note that like all arrays returned by Unity, this returns a copy of materials array. If you want to change some materials in it, get the value, change an entry and set materials back.

BoundsMax

SVector BoundsMax get

Property Description

BoundsMin

SVector BoundsMin get

Property Description

GameObject

SGameObject GameObject get

Property Description

float (float x, float y)

float (float x, float y)

float[,] ()

void (float[,] data)

void (int x, int y, float value)

SVector (float x, float y)

SVector (float x, float y)

SVector (float x, float y)

Properties Index

Property Name

bool get set

SGameObject get

Functions

GetHeight

float GetHeight (float x, float y)

Get an interpolated height at a point x,y.

Parameter
Type
Description

GetSteepness

float GetSteepness (float x, float y)

Get the gradient of the terrain at point (x,y).

Parameter
Type
Description

GetHeights

float[,] GetHeights ()

Returns a two dimensional array of heightmap samples. The samples are represented as float values ranging from 0 to 1. The array has the dimensions [height,width] and is indexed as [y,x].

SetHeights

void SetHeights (float[,] data)

Sets heightmap data using a two dimensional array of heightmap samples. The samples are represented as float values ranging from 0 to 1. The heights array is indexed as [y,x].

Parameter
Type
Description

SetHeight

void SetHeight (int x, int y, float value)

Set value to height of [x,y]

Parameter
Type
Description

GetNormal

SVector GetNormal (float x, float y)

Get an interpolated normal at a given location.

Parameter
Type
Description

GetSlope

SVector GetSlope (float x, float y)

Get a normalized and interpolated normal at a given location.

Parameter
Type
Description

GetContour

SVector GetContour (float x, float y)

Get a contour of interpolated normal at a given location.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Is the Terrain component enabled?

GameObject

SGameObject GameObject get

The GameObject that this Terrain component is added to.

bool get set

int get set

int get set

int get set

int get set

string get set

float get set

bool get set

bool get set

bool get set

bool get set

Properties

Enabled

bool Enabled get set

Is this UI layout component Enabled?

PaddingLeft

int PaddingLeft get set

Space reserved for the left edge of the padding during the layout phase.

PaddingRight

int PaddingRight get set

Space reserved for the right edge of the padding during the layout phase.

PaddingTop

int PaddingTop get set

Space reserved for the top edge of the padding during the layout phase.

PaddingBottom

int PaddingBottom get set

Space reserved for the bottom edge of the padding during the layout phase.

ChildAlignment

string ChildAlignment get set

Property Description

Spacing

float Spacing get set

The spacing to use between layout elements in the layout group.

ChildControlHeight

bool ChildControlHeight get set

Returns true if the Layout Group controls the heights of its children. Returns false if children control their own heights.

If set to false, the layout group will only affect the positions of the children while leaving the heights untouched. The heights of the children can be set via the respective RectTransforms in this case.

If set to true, the heights of the children are automatically driven by the layout group according to their respective minimum, preferred, and flexible heights. This is useful if the heights of the children should change depending on how much space is available. In this case the height of each child cannot be set manually in the RectTransform, but the minimum, preferred and flexible height for each child can be controlled by adding a LayoutElement component to it.

ChildControlWidth

bool ChildControlWidth get set

Returns true if the Layout Group controls the widths of its children. Returns false if children control their own widths.

If set to false, the layout group will only affect the positions of the children while leaving the widths untouched. The widths of the children can be set via the respective RectTransforms in this case.

If set to true, the widths of the children are automatically driven by the layout group according to their respective minimum, preferred, and flexible widths. This is useful if the widths of the children should change depending on how much space is available. In this case the width of each child cannot be set manually in the RectTransform, but the minimum, preferred and flexible width for each child can be controlled by adding a LayoutElement component to it.

ChildForceExpandHeight

bool ChildForceExpandHeight get set

Whether to force the children to expand to fill additional available vertical space.

ChildForceExpandWidth

bool ChildForceExpandWidth get set

Whether to force the children to expand to fill additional available horizontal space.

GridCellSize

SVector GridCellSize get set

The size to use for each cell in the grid.

GridSpacing

SVector GridSpacing get set

The spacing to use between layout elements in the grid.

GridConstraintCount

int GridConstraintCount get set

How many cells there should be along the constrained axis.

GridConstraint

string GridConstraint get set

Property Description

GameObject

SGameObject GameObject get

Property Description

void (Closure callback)

Properties Index

Property Name

bool get set

bool get set

bool get set

SColor get set

SColor get set

SColor get set

SColor get set

float get set

SGameObject get

Functions

OnValueChanged

void OnValueChanged (Closure callback)

Binds a function to be triggered when value of the UIToggle changes.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether the UIToggle is Enabled

Interactable

bool Interactable get set

Whether the UIToggle is Interactable

IsOn

bool IsOn get set

Whether the UIToggle is toggled On

NormalColor

SColor NormalColor get set

The normal color.

HighlightedColor

SColor HighlightedColor get set

The color of the control when it is highlighted.

PressedColor

SColor PressedColor get set

The color of the control when it is pressed.

DisabledColor

SColor DisabledColor get set

The color of the control when it is disabled.

ColorMultiplier

float ColorMultiplier get set

This multiplies the tint color for each transition by its value.

GameObject

SGameObject GameObject get

Property Description

void SetParent (SGameObject parent, bool worldPositionStays)

void SetInsetAndSizeFromParentEdge (int edge, float inset, float size)

void SetSizeWithCurrentAnchors (bool vertical, float size)

SRect Rect get

SVector anchorMin get set

SVector anchorMax get set

SVector anchoredPosition3D get set

SVector anchoredPosition get set

SVector sizeDelta get set

SVector pivot get set

SVector offsetMin get set

SVector offsetMax get set

SGameObject
SRect
SVector
SVector
SVector
SVector
SVector
SVector
SVector
SVector
SGameObject

SGameObject get

SAnimation

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

GetState

GetState () GetState (string state)

Returns the SAnimationState for the default animation clip.

Parameter
Type
Description

Blend

void Blend (string animation, float targetWeight=1.0F, float fadeLength=0.3F)

Blends the animation named animation towards targetWeight over the next time seconds. Playback of other animations will not be affected.

Parameter
Type
Description

CrossFade

void CrossFade (string animation, float fadeLength=0.3F)

Fades the animation with name animation in over a period of time seconds and fades other animations out.

If mode is PlayMode.StopSameLayer, animations in the same layer as animation will be faded out while animation is faded in. if mode is PlayMode.StopAll, all animations will be faded out while animation is faded in.

If the animation is not set to be looping it will be stopped and rewound after playing.

Parameter
Type
Description

CrossFadeQueued

CrossFadeQueued (string animation, float fadeLength=0.3F, bool playNow=false)

Returns a duplicated SAnimationState. This duplicate will self-destruct after it is finished playing. Referencing it after it has completed will result in an error.

Parameter
Type
Description

GetClipCount

int GetClipCount ()

Get the number of clips currently assigned to this animation.

IsPlaying

bool IsPlaying (string animation)

Is the animation named name playing?

Parameter
Type
Description

Play

bool Play () bool Play (string animation)

Plays an animation without any blending.

If no name is supplied then the default animation will be played. In cases where the animation can't be played (ie, there is no default animation or no animation with the specified name), the function will return false.

The optional playMode lets you choose how this animation will affect others already playing.

If the specified animation is already playing then other animations will be stopped but the animation will not rewind to the beginning.

When the end of the animation is reached it will automatically be stopped and rewound to the start unless the PlayMode is set to Loop.

Note that if you call Animation.Play on an object during a frame update where the object is also deactivated then the call will effectively be cancelled; the animation will not start playing when the object is later reactivated. However, if you make the call on a subsequent frame (ie, while the object is still inactive) then the animation will start playing after reactivation.

Parameter
Type
Description

PlayQueued

PlayQueued (string animation, bool playNow=false)

Returns a duplicated SAnimationState. This duplicate will self-destruct after it is finished playing. Referencing it after it has completed will result in an error.

Parameter
Type
Description

Rewind

void Rewind (string animation)

Rewinds the animation named name.

Parameter
Type
Description

Sample

void Sample ()

Samples animations at the current state.

This is useful when you explicitly want to set up some animation state, and sample it once.

Parameter
Type
Description

Stop

void Stop () void Stop (string animation)

Stops all playing animations that were started with this Animation.

Stopping an animation also Rewinds it to the Start.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether this component is enabled or not.

States

IDictionary< string, > States get

Returns a table of names and references

GameObject

GameObject get

Returns a reference to the GameObject of this component.

SEmbeddedVideo

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

OnStateChange

void OnStateChange (Closure e)

Function Description

Parameter
Type
Description

Play

void Play ()

If URL is set, plays the video

Stop

void Stop ()

Stops the playback

Pause

void Pause ()

Pauses currently played video

Resume

void Resume ()

If the video is currently paused, it will resume playback

SynchorizeUrl

void SynchorizeUrl ()

Synchorize current video URL

ClearRenderTexture

void ClearRenderTexture ()

Clears the Render Texture

Properties

State

State get

The state player is currently in. You can track state changes through StateChangeEvent.

URL

string URL get set

Current URL set for this Player.

AudioSource

AudioSource get set

Current AudioSource

OutputTexture

OutputTexture get

Property Description

Texture

Texture get

Texture which the player uses to display the video.

Time

double Time get set

Current player time. Can be set to move the 'playhead' to the specific position.

Position

long Position get

Current Video Frame Position

UniqueName

string UniqueName get

Property Description

VideoLength

double VideoLength get

Get the length of the video

Loop

bool Loop get set

Whether video is set to loop or not

FrameCount

int FrameCount get

Returns the frame count of the video

IsPlaying

bool IsPlaying get

Returns whether the video is playing or not

GameObject

GameObject get

Property Description

Space.Host.ExecutingObject.Camera.TakePhoto()
Space.Host.ExecutingObject.Camera.TakeSnapshot()
Space.Host.ExecutingObject.Camera.HDR = true
cameraWidthPixels = Space.Host.ExecutingObject.Camera.PixelWidth
cameraHeightPixels = Space.Host.ExecutingObject.Camera.PixelHeight
cameraVelocity = Space.Host.ExecutingObject.Camera.Velocity
Space.Host.ExecutingObject.Camera.UseOcclusionCulling = true
Space.Host.ExecutingObject.Camera.Enabled = true
--clicking this object will Enable/Disable it's Camera component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Camera

OnClick = function()
component.Enabled =  not component.Enabled
end

thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Camera.FieldOfView = 70
Space.Host.ExecutingObject.Camera.Orthographic = true
Space.Host.ExecutingObject.Camera.OrthographicSize = 5.0 
Space.Host.ExecutingObject.Camera.NearClip = 2.0 
Space.Host.ExecutingObject.Camera.FarClip = 6.0 
theGameObject = Space.Host.ExecutingObject.Camera.GameObject
--this object will move forward only if visible on a camera

thisObject = Space.Host.ExecutingObject


function OnUpdateFunction()
  
  if thisObject.MeshRenderer.IsVisible then
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * Space.DeltaTime * 0.2)
 end

end

thisObject.OnUpdate(OnUpdateFunction)
Space.Host.ExecutingObject.MeshRenderer.Enabled = false
--clicking this object will Enable/Disable it's Mesh Renderer component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.MeshRenderer

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.MeshRenderer.Material.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
--clicking this object will toggle it's material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject


function OnClickFunction()
  if thisObject.MeshRenderer.Material.GetColor("_Color") == Color.Black then
    thisObject.MeshRenderer.Material.SetColor("_Color", Color.Red)
  else
    thisObject.MeshRenderer.Material.SetColor("_Color", Color.Black)
  end

end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.MeshRenderer.SharedMaterial.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
--clicking this object will toggle it's shared material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject


function OnClickFunction()
  if thisObject.MeshRenderer.SharedMaterial.GetColor("_Color") == Color.Black then
    thisObject.MeshRenderer.SharedMaterial.SetColor("_Color", Color.Red)
  else
    thisObject.MeshRenderer.SharedMaterial.SetColor("_Color", Color.Black)
  end

end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
mats = Space.Host.ExecutingObject.MeshRenderer.Materials
Space.Host.ExecutingObject.MeshRenderer.SharedMaterial.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
--clicking this object will toggle it's shared material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  if thisObject.MeshRenderer.SharedMaterial.GetColor("_Color") == Color.Black then
    thisObject.MeshRenderer.SharedMaterial.SetColor("_Color", Color.Red)
  else
    thisObject.MeshRenderer.SharedMaterial.SetColor("_Color", Color.Black)
  end

end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.MeshRenderer.BoundsMax = Vector.New(1,1,1)
Space.Host.ExecutingObject.MeshRenderer.BoundsMin = Vector.New(0,0,0)
isVisible = Space.Host.ExecutingObject.Renderer.IsVisible
--this object will move forward only if visible on a camera

thisObject = Space.Host.ExecutingObject


function OnUpdateFunction()
  
  if thisObject.Renderer.IsVisible then
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * Space.DeltaTime * 0.2)
 end

end

thisObject.OnUpdate(OnUpdateFunction)
Space.Host.ExecutingObject.Renderer.Enabled = false 
--clicking this object will make it disappear/reappear

thisGameObject = Space.Host.ExecutingObject


OnClick = function()
thisGameObject.Renderer.Enabled = not thisGameObject.Renderer.Enabled
end

thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Renderer.Material.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
--clicking this object will toggle it's material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject


function OnClickFunction()
  if thisObject.Renderer.Material.GetColor("_Color") == Color.Black then
    thisObject.Renderer.Material.SetColor("_Color", Color.Red)
  else
    thisObject.Renderer.Material.SetColor("_Color", Color.Black)
  end

end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.Renderer.SharedMaterial.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
--clicking this object will toggle it's shared material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject


function OnClickFunction()
  if thisObject.Renderer.SharedMaterial.GetColor("_Color") == Color.Black then
    thisObject.Renderer.SharedMaterial.SetColor("_Color", Color.Red)
  else
    thisObject.Renderer.SharedMaterial.SetColor("_Color", Color.Black)
  end

end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
mats = Space.Host.ExecutingObject.Renderer.Materials
sharedMats = Space.Host.ExecutingObject.Renderer.SharedMaterials
vectorBoundsMax = Space.Host.ExecutingObject.Renderer.BoundsMax 
vectorBoundsMin = Space.Host.ExecutingObject.Renderer.BoundsMin 
theGameObject = Space.Host.ExecutingObject.Renderer.GameObject
floatHeight = Space.Host.ExecutingObject.Terrain.GetHeight(1,1)
floatSteepness = Space.Host.ExecutingObject.Terrain.GetSteepness(1,1)
tableHeights = Space.Host.ExecutingObject.Terrain.GetHeights()
tableHeights = Space.Host.ExecutingObject.Terrain.SetHeights({{1,2},{1,2}})
Space.Host.ExecutingObject.Terrain.SetHeight(1,1,0.11) 
vectorNormal = Space.Host.ExecutingObject.Terrain.GetNormal(1,1)
vectorSlope = Space.Host.ExecutingObject.Terrain.GetSlope(1,1)
vectorContour = Space.Host.ExecutingObject.Terrain.GetContour(1,1)
Space.Host.ExecutingObject.Terrain.Enabled = false
theGameObject = Space.Host.ExecutingObject.Terrain.GameObject
Space.Host.ExecutingObject.UILayout.Enabled = false
--clicking this object will toggle a Layout's Enabled status

thisGameObject = Space.Host.ExecutingObject
layout = Space.Host.GetReference("layout").UILayout 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
layout.Enabled=  not layout.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UILayout.PaddingLeft= 2
Space.Host.ExecutingObject.UILayout.PaddingRight= 2
Space.Host.ExecutingObject.UILayout.PaddingTop= 2
Space.Host.ExecutingObject.UILayout.PaddingBottom= 2
Space.Host.ExecutingObject.UILayout.ChildAlignment = "1"
Space.Host.ExecutingObject.UILayout.Spacing= 2
Space.Host.ExecutingObject.UILayout.ChildControlHeight= true
Space.Host.ExecutingObject.UILayout.ChildControlWidth= false
Space.Host.ExecutingObject.UILayout.ChildForceExpandHeight= false
Space.Host.ExecutingObject.UILayout.ChildForceExpandWidth= false
Space.Host.ExecutingObject.UILayout.GridCellSize= Vector.New(1,1,0)
Space.Host.ExecutingObject.UILayout.GridSpacing= Vector.New(1,1,0)
Space.Host.ExecutingObject.UILayout.GridConstraintCount= 2
Space.Host.ExecutingObject.UILayout.GridConstraint = 1
theGameObject = Space.Host.ExecutingObject.UILayout.GridConstraint
function ovc()
--
end
Space.Host.ExecutingObject.UIToggle.OnValueChanged(ovc)
--This script will make a UI Toggle show/hide the Notification Button
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowNotificationButton= true
  else
    Space.UI.ShowNotificationButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)
Space.Host.ExecutingObject.UIToggle.Enabled = true
--clicking this object will toggle a Toggles's Enabled status

thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
toggle.Enabled =  not toggle.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UIToggle.Interactable = true
--clicking this object will toggle a Toggles's Interactable status

thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
toggle.Interactable=  not toggle.Interactable
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UIToggle.IsOn = true
--This script will make a UI Toggle show/hide the Notification Button
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowNotificationButton= true
  else
    Space.UI.ShowNotificationButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)
Space.Host.ExecutingObject.UIToggle.NormalColor = Color.Red
Space.Host.ExecutingObject.UIToggle.HighlightedColor = Color.Red
Space.Host.ExecutingObject.UIToggle.PressedColor = Color.Red
Space.Host.ExecutingObject.UIToggle.DisabledColor = Color.Red
Space.Host.ExecutingObject.UIToggle.ColorMultiplier = 1.2
theGameObject = Space.Host.ExecutingObject.UIToggle.GameObject
Space.Host.ExecutingObject.RectTransform.SetParent(anotherGameObject)
Space.Host.ExecutingObject.RectTransform.SetInsetAndSizeFromParentEdge(2, 3.0, 10.0)
Space.Host.ExecutingObject.RectTransform.SetSizeWithCurrentAnchors(true, 10.0)
rect = Space.Host.ExecutingObject.RectTransform.Rect
Space.Host.ExecutingObject.RectTransform.anchorMin= Vector.New(0.3,0.3,0)
Space.Host.ExecutingObject.RectTransform.anchorMax= Vector.New(0.7,0.6,0)
Space.Host.ExecutingObject.RectTransform.anchoredPosition3D= Vector.New(0.7,0.6,0)
Space.Host.ExecutingObject.RectTransform.anchoredPosition= Vector.New(0.7,0.6,0)
Space.Host.ExecutingObject.RectTransform.sizeDelta= Vector.New(90,90,0)
Space.Host.ExecutingObject.RectTransform.pivot= Vector.New(0.4,0.4,0)
Space.Host.ExecutingObject.RectTransform.offsetMin= Vector.New(-50,-50,0)
Space.Host.ExecutingObject.RectTransform.offsetMax= Vector.New(50,50,0)
theGameObject = Space.Host.ExecutingObject.RectTransform.GameObject
NearClip
FarClip
GameObject
IsVisible
Enabled
Material
SharedMaterial
Materials
SharedMaterials
BoundsMax
BoundsMin
IsVisible
Enabled
Material
SharedMaterial
Materials
SharedMaterials
BoundsMax
BoundsMin
GameObject
GetHeight
GetSteepness
GetHeights
SetHeights
SetHeight
GetNormal
GetSlope
GetContour
Enabled
GameObject

SVector GridCellSize get set

SVector GridSpacing get set

int GridConstraintCount get set

string GridConstraint get set

SGameObject GameObject get

Enabled
PaddingLeft
PaddingRight
PaddingTop
PaddingBottom
ChildAlignment
Spacing
ChildControlHeight
ChildControlWidth
ChildForceExpandHeight
ChildForceExpandWidth
OnValueChanged
Enabled
Interactable
IsOn
NormalColor
HighlightedColor
PressedColor
DisabledColor
ColorMultiplier
GameObject

SAnimationState GetState ()

SAnimationState GetState (string state)

void Blend (string animation, float targetWeight=1.0F, float fadeLength=0.3F)

void CrossFade (string animation, float fadeLength=0.3F)

SAnimationState CrossFadeQueued (string animation, float fadeLength=0.3F, bool playNow=false)

int GetClipCount ()

bool IsPlaying (string animation)

bool Play ()

bool Play (string animation)

SAnimationState PlayQueued (string animation, bool playNow=false)

void Rewind (string animation)

void Sample ()

void Stop ()

void Stop (string animation)

bool Enabled get set

IDictionary< string, SAnimationState > States get

SAnimationState
SAnimationState
SAnimationState
SAnimationState
SAnimationState
SAnimationState
SGameObject
State = Space.Host.ExecutingObject.Animation.GetState()
State = Space.Host.ExecutingObject.Animation.GetState("statename")
Space.Host.ExecutingObject.Animation.Blend("animationname",1.0,0.3)
Space.Host.ExecutingObject.Animation.CrossFade("animationname", 0.3)
NewSAnimationState = Space.Host.ExecutingObject.Animation.CrossFadeQueued("animationname", 0.3, false)
NumberOfClips = Space.Host.ExecutingObject.Animation.GetClipCount() 
IsPlaying = Space.Host.ExecutingObject.Animation.IsPlaying("animationname")
Space.Host.ExecutingObject.Animation.Play()
Space.Host.ExecutingObject.Animation.Play("animationname")
Space.Host.ExecutingObject.Animation.PlayQueued("animationname","false")
Space.Host.ExecutingObject.Animation.Rewind()
Space.Host.ExecutingObject.Animation.Sample()
Space.Host.ExecutingObject.Animation.Stop()
Space.Host.ExecutingObject.Animation.Stop("animationname")
Space.Host.ExecutingObject.Animation.Enabled = false
--clicking this object will Enable/Disable it's Animation component
thisGameObject = Space.Host.ExecutingObject
animation = thisGameObject.Animation


OnClick = function()
animation.Enabled =  not animation.Enabled
end

thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
States = Space.Host.ExecutingObject.Animation.States
theGameObject = Space.Host.ExecutingObject.Animation.GameObject

int get

bool get

SGameObject get

void OnStateChange (Closure e)

void Play ()

void Stop ()

void Pause ()

void Resume ()

void SynchorizeUrl ()

void ClearRenderTexture ()

SEmbeddedVideoState State get

string URL get set

SAudioSource AudioSource get set

SResource OutputTexture get

SResource Texture get

double Time get set

long Position get

string UniqueName get

double VideoLength get

SEmbeddedVideoState
SAudioSource
SResource
SResource
SGameObject

bool get set

SAudioReactiveLight

Index

Properties Index

Property Name

Properties

Enabled

bool Enabled get set

Returns true if the Audio Reactive Light Enabled.

Target

SLight Target get set

Returns true if the light target Enabled.

Range

bool Range get set

Returns true if Range Enabled.

MinRange

float MinRange get set

Returns MinRange value of the Audio Reactive Light.

MaxRange

float MaxRange get set

Returns MaxRange value of the Audio Reactive Light.

AnimateColor

bool AnimateColor get set

Returns true if AnimateColor Enabled.

MinColor

MinColor get set

Returns MinColor value of the Audio Reactive Light.

MaxColor

MaxColor get set

Returns MaxColor value of the Audio Reactive Light.

Intensity

bool Intensity get set

Returns true if Intensity Enabled.

MinIntensity

float MinIntensity get set

Returns MinIntensity value of the Audio Reactive Light.

MaxIntensity

float MaxIntensity get set

Returns MaxIntensity value of the Audio Reactive Light.

GameObject

GameObject get

Returns a reference to the GameObject of this component.

SSceneBackgroundMusic

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

Play

void Play ()

Plays the radio stream

PlayMP3Stream

void PlayMP3Stream (string url)

Sets the given MP3 stream url as current stream

Parameter
Type
Description

PlayVorbisStream

void PlayVorbisStream (string url)

Sets the given Vorbis stream url as current stream

Parameter
Type
Description

Stop

void Stop ()

Stops playing the radio stream

OnTrackChange

void OnTrackChange (Closure o) void OnTrackChange (Action< > trackInfoCallback)

Function will be called when track changes.

Parameter
Type
Description

OnUpcomingTrackChange

void OnUpcomingTrackChange (Closure o) void OnUpcomingTrackChange (Action< > trackInfoCallback)

Function will be called when there's an upcoming track change

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Is this component Enabled?

URL

string URL get

URL of the current stream

GameObject

GameObject get

Property Description

SHingeJoint

Index

Properties Index

Property Name

SVoiceZone

Index

Functions Index

Function Name
function stateChangeFunction(EmbeddedVideo, oldState, newState)
--what happens on state change
end

Space.Host.ExecutingObject.EmbeddedVideo.OnStageChange(stateChangeFunction)
--get embedded video component on your video player 
video = Space.Scene.Find("VidepPlayer").EmbeddedVideo
function GetClosure()
return function (a,b,c)
log(a.URL..b..c)
end
end
video.OnStateChange(GetClosure())
video.Pause()
Space.Host.ExecutingObject.EmbeddedVideo.Play()
Space.Host.ExecutingObject.EmbeddedVideo.Stop()
Space.Host.ExecutingObject.EmbeddedVideo.Pause()
Space.Host.ExecutingObject.EmbeddedVideo.Resume()
Space.Host.ExecutingObject.EmbeddedVideo.SynchorizeUrl()
Space.Host.ExecutingObject.EmbeddedVideo.ClearRenderTexture()
 CurrentVideoState = Space.Host.ExecutingObject.EmbeddedVideo.State
CurrentURL = Space.Host.ExecutingObject.EmbeddedVideo.URL
CurrentAudioSource = Space.Host.ExecutingObject.EmbeddedVideo.AudioSource
OutputTexture = Space.Host.ExecutingObject.EmbeddedVideo.OutputTexture
 Texture = Space.Host.ExecutingObject.EmbeddedVideo.Texture
Time = Space.Host.ExecutingObject.EmbeddedVideo.Time
Position = Space.Host.ExecutingObject.EmbeddedVideo.Position
UniqueName = Space.Host.ExecutingObject.EmbeddedVideo.UniqueName
VideoLength = Space.Host.ExecutingObject.EmbeddedVideo.VideoLength
 Space.Host.ExecutingObject.EmbeddedVideo.Loop  = true
FrameCount = Space.Host.ExecutingObject.EmbeddedVideo.FrameCount
IsPlaying = Space.Host.ExecutingObject.EmbeddedVideo.IsPlaying
theGameObject = Space.Host.ExecutingObject.EmbeddedVideo.GameObject
Loop
FrameCount
IsPlaying
GameObject

bool Enabled get set

SLight Target get set

bool Range get set

float MinRange get set

float MaxRange get set

bool AnimateColor get set

SColor MinColor get set

SColor MaxColor get set

bool Intensity get set

float MinIntensity get set

float MaxIntensity get set

SColor
SColor
SGameObject

void Play ()

void PlayMP3Stream (string url)

void PlayVorbisStream (string url)

void Stop ()

void OnTrackChange (Closure o) void OnTrackChange (Action< STrackInfo > trackInfoCallback)

void OnUpcomingTrackChange (Closure o) void OnUpcomingTrackChange (Action< STrackInfo > trackInfoCallback)

bool Enabled get set

string URL get

SGameObject GameObject get

STrackInfo
STrackInfo
SGameObject
Space.Host.ExecutingObject.AudioReactiveLight.Enabled = true
--clicking this object will Enable/Disable it's Audio Reactive Light component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveLight


OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactiveLight.Target = false
--clicking the object will toggle between two different AudioReactiveLight targets
--[Add "light1" and "light2" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
light1 = Space.Host.GetReference("light1").Light
light2 = Space.Host.GetReference("light2").Light


OnClick = function()
if thisGameObject.AudioReactiveLight.Target == light1 then
  thisGameObject.AudioReactiveLight.Target = light2
else
  thisGameObject.AudioReactiveLight.Target = light1
end

end



thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactiveLight.Range = false
--the below script will make the object toggle it's AudioReactiveLight's Range property
--[Add "arlight" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight


OnClick = function()
arlight.Range=  not arlight.Range
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactiveLight.MinRange = 0.5
--the below script will make a slider set the Audio Reactive Light's MinRange
--[Add "slider" and "arlight" references to the Scripting Runtime component]

arlight = Space.Host.GetReference("arlight").AudioReactiveLight
slider = Space.Host.GetReference("slider").UISlider
 

OVC = function()
arlight.MinRange = (slider.Value * 9) + 1 --(from 1 to 10)
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactiveLight.MaxRange = 1
--the below script will make a slider set the Audio Reactive Light's MaxRange
--[Add "slider" and "arlight" references to the Scripting Runtime component]

arlight = Space.Host.GetReference("arlight").AudioReactiveLight
slider = Space.Host.GetReference("slider").UISlider
 

OVC = function()
arlight.MaxRange= (slider.Value * 10) + 10 --(from 10 to 20)
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactiveLight.AnimateColor = false
--the below script will make the object Enable/Disable it's AudioReactiveLight's AnimateColor property
--[Add "arlight" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight


OnClick = function()
arlight.AnimateColor =  not arlight.AnimateColor
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactiveLight.MinColor  = Color.Red
--clicking the object will open a color picker that changes AudioReactiveLight's MinColor
--[Add "arlight" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
originalColor = nil

OnChange = function(SColor) 
 arlight.MinColor = SColor
end

OnSelect = function(SColor)
 arlight.MinColor = SColor
end

OnCancel = function()
 arlight.MinColor = originalColor
end

OnClick = function()
originalColor = arlight.MinColor
Space.Dialogues.ColorPicker("Pick a color","Ok", OnChange, OnSelect, OnCancel, originalColor)
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactiveLight.MaxColor = Color.Blue
--clicking the object will open a color picker that changes AudioReactiveLight's MaxColor
--[Add "arlight" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
originalColor = nil

OnChange = function(SColor) 
 arlight.MaxColor= SColor
end

OnSelect = function(SColor)
 arlight.MaxColor= SColor
end

OnCancel = function()
 arlight.MaxColor= originalColor
end

OnClick = function()
originalColor = arlight.MaxColor
Space.Dialogues.ColorPicker("Pick a color","Ok", OnChange, OnSelect, OnCancel, originalColor)
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactiveLight.Intensity = false
--the below script will make the object Enable/Disable it's AudioReactiveLight's Intensity property
--[Add "arlight" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight


OnClick = function()
arlight.Intensity =  not arlight.Intensity
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.AudioReactiveLight.MinIntensity = 0.2
--the below script will make a slider set the Audio Reactive Light's MinIntensity
--[Add "slider" and "arlight" references to the Scripting Runtime component]

arlight = Space.Host.GetReference("arlight").AudioReactiveLight
slider = Space.Host.GetReference("slider").UISlider
 

OVC = function()
arlight.MinIntensity= (slider.Value * 1) --(from 0 to 1)
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.AudioReactiveLight.MaxIntensity = 0.8
--the below script will make a slider set the Audio Reactive Light's MaxIntensity
--[Add "slider" and "arlight" references to the Scripting Runtime component]

arlight = Space.Host.GetReference("arlight").AudioReactiveLight
slider = Space.Host.GetReference("slider").UISlider
 

OVC = function()
arlight.MaxIntensity= (slider.Value * 2) + 1 --(from 1 to 3)
end

slider.OnValueChanged(OVC)
theGameObject = Space.Host.ExecutingObject.AudioReactiveLight.GameObject
Space.Host.ExecutingObject.Radio.Play()
 --this script will let us click a radio to make it start playing
--(Example: clicking a light switch toggle's a parent light bulb's intensity)
--[Requires a "Shoutcast Streaming" component on the parent of this object]

thisGameObject = Space.Host.ExecutingObject
IsPlaying = false


StartPlaying = function()
thisGameObject.Radio.Play()
IsPlaying = true
end

StopPlaying = function()
thisGameObject.Radio.Stop()
IsPlaying = false
end


OnClick = function()
    if IsPlaying then
      StopPlaying()
    else
      StartPlaying()
    end
end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Toggle Play/Stop"
thisGameObject.Clickable.OnClick(OnClick) 
Space.Host.ExecutingObject.Radio.PlayMP3Stream("http://stream.example.org:1234/")
Space.Host.ExecutingObject.Radio.PlayVorbisStream("http://stream.example.org:1234/")
Space.Host.ExecutingObject.Radio.Stop()
--this script will let us click a radio to make it start playing
--(Example: clicking a light switch toggle's a parent light bulb's intensity)
--[Requires a "Shoutcast Streaming" component on the parent of this object]

thisGameObject = Space.Host.ExecutingObject
IsPlaying = false


StartPlaying = function()
thisGameObject.Radio.Play()
IsPlaying = true
end

StopPlaying = function()
thisGameObject.Radio.Stop()
IsPlaying = false
end


OnClick = function()
    if IsPlaying then
      StopPlaying()
    else
      StartPlaying()
    end
end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Toggle Play/Stop"
thisGameObject.Clickable.OnClick(OnClick)
otc = function(trackInfo)
  end
Space.Host.ExecutingObject.Radio.OnTrackChange(otc)
--this script will update a UIText object with the track title on track change
--[this GameObject needs a "Shoutcast Streaming"/"SceneBackgroundMusic" component]

thisObj = Space.Host.ExecutingObject

text = Space.Host.GetReference("Text") -- set in Scripting Runtime references

otc = function(trackInfo)
text.UIText.Text = "Track: " .. trackInfo.Title .. " by " .. trackInfo.Artist
end

thisObj.Radio.OnTrackChange(otc)
otc = function(trackInfo)

end
Space.Host.ExecutingObject.Radio.OnUpcomingTrackChange(otc)
--this script will update a UIText object with the track title on upcoming track change
--[this GameObject needs a "Shoutcast Streaming"/"SceneBackgroundMusic" component]

thisObj = Space.Host.ExecutingObject

text = Space.Host.GetReference("Text") -- set in Scripting Runtime references

outc = function(upcomingTrackInfo)
text.UIText.Text = "Track: " .. upcomingTrackInfo.Title .. " by " .. upcomingTrackInfo.Artist
end

thisObj.Radio.OnUpcomingTrackChange(outc)
Space.Host.ExecutingObject.Radio.Enabled = true
--clicking this object will Enable/Disable it's Scene Background Music component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Radio

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
streamURL = Space.Host.ExecutingObject.Radio.URL 
--this script will update a UIText object with the current stream URL
--[this GameObject needs a "Shoutcast Streaming"/"SceneBackgroundMusic" component]

thisObj = Space.Host.ExecutingObject

text = Space.Host.GetReference("Text") -- set in Scripting Runtime references


OnUpdate = function()
text.UIText.Text = thisObj.Radio.URL
end

thisObj.OnUpdate(OnUpdate)
theGameObject = Space.Host.ExecutingObject.Floor.GameObject

SRigidbody get set

SVector get set

SVector get set

SVector get set

bool get set

float get set

float get set

bool get set

bool get set

SVector get

SVector get

Properties

ConnectedBody

SRigidbody ConnectedBody get set

Set joint to a rigidbody. If not set, the joint connects to the world.

Axis

SVector Axis get set

The direction of the axis around which the body swings. The direction is defined in local space.

Anchor

SVector Anchor get set

The position of the axis around which the body swings. The position is defined in local space.

ConnectedAnchor

SVector ConnectedAnchor get set

Manual configuration of the connected anchor position.

AutoConfigureConnectedAnchor

bool AutoConfigureConnectedAnchor get set

If this is enabled, then the Connected Anchor position will be calculated automatically to match the global position of the anchor property. This is the default behavior. If this is disabled, you can configure the position of the connected anchor manually.

BreakForce

float BreakForce get set

Apply the force to break the joint.

BreakTorque

float BreakTorque get set

Apply the torque to break the joint.

EnableCollision

bool EnableCollision get set

When checked, this enables collisions between bodies connected with a joint.

EnablePreprocessing

bool EnablePreprocessing get set

Disabling preprocessing helps to stabilize impossible-to-fulfil configurations.

CurrentForce

SVector CurrentForce get

The force applied by the solver to satisfy all constraints.

CurrentTorque

SVector CurrentTorque get

The torque applied by the solver to satisfy all constraints.

MassScale

float MassScale get set

The scale to apply to the inverse mass and inertia tensor of the body

ConnectedMassScale

float ConnectedMassScale get set

The scale to apply to the inverse mass and inertia tensor of the connected body

Motor

SJointMotor Motor get set

The motor makes the object spin around.

Limits

SJointLimits Limits get set

The motor makes the object spin around.

Spring

SJointSpring Spring get set

The motor makes the object spin around.

UseMotor

bool UseMotor get set

The motor makes the object spin around.

UseLimits

bool UseLimits get set

If enabled, the angle of the hinge will be restricted within the Min & Max values.

UseSpring

bool UseSpring get set

Spring makes the Rigidbody reach for a specific angle compared to its connected body.

Velocity

float Velocity get

The angular velocity of the joint in degrees per second.

Angle

float Angle get

The current angle in degrees of the joint relative to its rest position.

GameObject

SGameObject GameObject get

Property Description

void (bool enabled)

void ()

void (bool enabled)

void ()

void (uint userID)

void (uint userID)

void (uint userID)

void (uint userID)

Properties Index

Property Name

bool get set

bool get set

bool get set

bool get set

bool get set

int get

string get

bool get

bool get

Functions

SetOverrideVoice

void SetOverrideVoice (bool enabled)

Set voice to override the original voice.

Parameter
Type
Description

ClearOverrideVoice

void ClearOverrideVoice ()

Clear the overriding voice.

SetOverrideVideo

void SetOverrideVideo (bool enabled)

Function Description

Parameter
Type
Description

ClearOverrideVideo

void ClearOverrideVideo ()

Function Description

AddAuthVoiceUser

void AddAuthVoiceUser (uint userID)

Add a user to AuthVoiceUser by his ID.

Parameter
Type
Description

RemoveAuthVoiceUser

void RemoveAuthVoiceUser (uint userID)

Remove a user from AuthVoiceUser by his ID.

Parameter
Type
Description

AddAuthVideoUser

void AddAuthVideoUser (uint userID)

Function Description

Parameter
Type
Description

RemoveAuthVideoUser

void RemoveAuthVideoUser (uint userID)

Remove a user from AuthVoiceUser by his ID.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether the Voice Zone component is Enabled

AllowVoice

bool AllowVoice get set

Whether allows voice.

AllowVideo

bool AllowVideo get set

Whether allows video.

ConnectVoiceService

bool ConnectVoiceService get set

Property Description

ConnectVideoService

bool ConnectVideoService get set

Property Description

Priority

int Priority get

The priority of the voice zone

AreaName

string AreaName get

The name of area.

Spatialized

bool Spatialized get

Whether the voice zone is spatialized.

SpatialDropoff

bool SpatialDropoff get

Whether the voice zone is spatialized drop off.

SpatialStereo

bool SpatialStereo get

Whether the voice zone is spatial stereo.

SpatialDistance

float SpatialDistance get

The spatial distance of the voice zone.

Global

bool Global get

Whether the voice zone is global.

AuthVideoUsers

uint[] AuthVideoUsers get

Return an array of auth video user.

AuthVoiceUsers

uint[] AuthVoiceUsers get

Property Description

GameObject

SGameObject GameObject get

Property Description

SUIImage

Index

Properties Index

Property Name

Properties

Color

Color get set

Default Color of UIImage

Sprite

Sprite get set

The sprite that is used to render this image.

PreserveAspect

bool PreserveAspect get set

Whether this image should preserve its Sprite aspect ratio.

FillCenter

bool FillCenter get set

Whether or not to render the center

FillAmount

float FillAmount get set

Amount of the Image shown

FillClockwise

bool FillClockwise get set

Whether the Image should be filled clockwise (true) or counter-clockwise (false).

FillOrigin

int FillOrigin get set

Controls the origin point of the Fill process.

AlphaHitTestMinimumThreshold

float AlphaHitTestMinimumThreshold get set

The alpha threshold specifies the minimum alpha a pixel must have for the event to considered a "hit" on the Image. Alpha values less than the threshold will cause raycast events to pass through the Image. An value of 1 would cause only fully opaque pixels to register raycast events on the Image. The alpha tested is retrieved from the image sprite only, while the alpha of the Image Graphic.color is disregarded.

alphaHitTestMinimumThreshold defaults to 0; all raycast events inside the Image rectangle are considered a hit. In order for greater than 0 to values to work, the sprite used by the Image must have readable pixels. This can be achieved by enabling Read/Write enabled in the advanced Texture Import Settings for the sprite and disabling atlassing for the sprite.

HasBorder

bool HasBorder get

True if the sprite used has borders.

PixelsPerUnit

float PixelsPerUnit get

Provides information about how fonts are scale to the screen.

For dynamic fonts, the value is equivalent to the scale factor of the canvas. For non-dynamic fonts, the value is calculated from the requested text size and the size from the font.

Material

Material get set

The specified Material used by this Image. The default Material is used instead if one wasn't specified.

MinWidth

float MinWidth get

The minimum width this UIImage may be allocated. (Used by the Layout system).

PreferredWidth

float PreferredWidth get

The preferred width this UIImage should be allocated if there is sufficient space. (Used by the Layout system)

FlexibleWidth

float FlexibleWidth get

The extra relative width this UIImage should be allocated if there is additional available space. (Used by the Layout system)

MinHeight

float MinHeight get

The minimum height this UIImage may be allocated.(Used by the Layout system).

PreferredHeight

float PreferredHeight get

The preferred height this UIImage should be allocated if there is sufficient space. (Used by the Layout system)

FlexibleHeight

float FlexibleHeight get

The extra relative height this UIImage should be allocated if there is additional available space. (Used by the Layout system)

LayoutPriority

int LayoutPriority get

The layout priority of this UIText component.(Used by the Layout system.)

GameObject

GameObject get

Property Description

SUIDropdown

Index

Functions Index

Function Name
connectedRigidBody = Space.Host.ExecutingObject.HingeJoint.ConnectedBody
Space.Host.ExecutingObject.HingeJoint.Axis = Vector.New(0,1,0)
Space.Host.ExecutingObject.HingeJoint.Anchor = Vector.New(0, 0.5 , 0)
Space.Host.ExecutingObject.HingeJoint.ConnectedAnchor = Vector.New(1,1,1)
Space.Host.ExecutingObject.HingeJoint.AutoConfigureConnectedAnchor = false
Space.Host.ExecutingObject.HingeJoint.BreakForce = 20
Space.Host.ExecutingObject.HingeJoint.BreakTorque = 1
Space.Host.ExecutingObject.HingeJoint.EnableCollision = true
Space.Host.ExecutingObject.HingeJoint.EnablePreprocessing = true
vectorForce = Space.Host.ExecutingObject.HingeJoint.CurrentForce
vectorTorque = Space.Host.ExecutingObject.HingeJoint.CurrentTorque
Space.Host.ExecutingObject.HingeJoint.MassScale = 2
Space.Host.ExecutingObject.HingeJoint.ConnectedMassScale = 2
jointMotor = Space.Host.ExecutingObject.HingeJoint.Motor 
jointLimits = Space.Host.ExecutingObject.HingeJoint.Limits
jointSpring = Space.Host.ExecutingObject.HingeJoint.Spring
Space.Host.ExecutingObject.HingeJoint.UseMotor = true
Space.Host.ExecutingObject.HingeJoint.UseLimits = true
Space.Host.ExecutingObject.HingeJoint.UseSpring = true
floatVelocity = Space.Host.ExecutingObject.HingeJoint.Velocity
floatAngle = Space.Host.ExecutingObject.HingeJoint.Angle
theGameObject = Space.Host.ExecutingObject.HingeJoint.GameObject
Space.Host.ExecutingObject.VoiceZone.SetOverrideVoice(true)
Space.Host.ExecutingObject.VoiceZone.ClearOverrideVoice()
Space.Host.ExecutingObject.VoiceZone.SetOverrideVideo(true)
Space.Host.ExecutingObject.VoiceZone.SetOverrideVideo(true)
Space.Host.ExecutingObject.VoiceZone.AddAuthVoiceUser(000000000)
lSpace.Host.ExecutingObject.VoiceZone.RemoveAuthVoiceUser(000000000)
Space.Host.ExecutingObject.VoiceZone.AddAuthVideoUser(000000000)
Space.Host.ExecutingObject.VoiceZone.RemoveAuthVideoUser(000000000)
Space.Host.ExecutingObject.VoiceZone.Enabled = true
--clicking this object will Enable/Disable it's Voice Zone component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.VoiceZone

OnClick = function()
component.Enabled =  not component.Enabled
end

thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.VoiceZone.AllowVoice = true
Space.Host.ExecutingObject.VoiceZone.AllowVideo = true
Space.Host.ExecutingObject.VoiceZone.ConnectVoiceService = true
Space.Host.ExecutingObject.VoiceZone.ConnectVideoService = true
priority = Space.Host.ExecutingObject.VoiceZone.Priority
priority = Space.Host.ExecutingObject.VoiceZone.AreaName
isSpatialized = Space.Host.ExecutingObject.VoiceZone.Spatialized
spatialDropoff = Space.Host.ExecutingObject.VoiceZone.SpatialDropoff
spatialStereo = Space.Host.ExecutingObject.VoiceZone.SpatialStereo
floatDistance = Space.Host.ExecutingObject.VoiceZone.SpatialDistance
isGlobal = Space.Host.ExecutingObject.VoiceZone.Global
tableAuthVideoUsers = Space.Host.ExecutingObject.VoiceZone.AuthVideoUsers
tableAuthVideoUsers = Space.Host.ExecutingObject.VoiceZone.AuthVoiceUsers
theGameObject = Space.Host.ExecutingObject.VoiceZone.GameObject

float MassScale get set

float ConnectedMassScale get set

SJointMotor Motor get set

SJointLimits Limits get set

SJointSpring Spring get set

bool UseMotor get set

bool UseLimits get set

bool UseSpring get set

float Velocity get

float Angle get

SGameObject GameObject get

ConnectedBody
Axis
Anchor
ConnectedAnchor
AutoConfigureConnectedAnchor
BreakForce
BreakTorque
EnableCollision
EnablePreprocessing
CurrentForce
CurrentTorque

bool SpatialStereo get

float SpatialDistance get

bool Global get

uint[] AuthVideoUsers get

uint[] AuthVoiceUsers get

SGameObject GameObject get

SetOverrideVoice
ClearOverrideVoice
SetOverrideVideo
ClearOverrideVideo
AddAuthVoiceUser
RemoveAuthVoiceUser
AddAuthVideoUser
RemoveAuthVideoUser
Enabled
AllowVoice
AllowVideo
ConnectVoiceService
ConnectVideoService
Priority
AreaName
Spatialized
SpatialDropoff

float get

float get

float get

float get

float get

int get

SGameObject get

SColor Color get set

SResource Sprite get set

bool PreserveAspect get set

bool FillCenter get set

float FillAmount get set

bool FillClockwise get set

int FillOrigin get set

float AlphaHitTestMinimumThreshold get set

bool HasBorder get

float PixelsPerUnit get

SMaterial Material get set

SColor
SResource
SMaterial
SGameObject

float get

void ()

void (string[] options) void (Table options) void (SResource[] optionsSprites)

void ()

void ()

void ()

void (Closure callback)

Properties Index

Property Name

bool get set

SGameObject get set

SUIText get set

SUIImage get set

SUIText get set

SUIImage get set

string[] get

SResource[] get

int get set

Functions

RefreshShownValue

void RefreshShownValue ()

Refreshes the text and image (if available) of the currently selected option.If you have modified the list of options, you should call this method afterwards to ensure that the visual state of the dropdown corresponds to the updated options.

Parameter
Type
Description

AddOptions

void AddOptions (string[] options) void AddOptions (Table options) void AddOptions (SResource[] optionsSprites)

Add multiple options to the options of the Dropdown.

Parameter
Type
Description

ClearOptions

void ClearOptions ()

Clear the list of options in the Dropdown.

Show

void Show ()

Show the dropdown list.

Hide

void Hide ()

Hide the dropdown list.

OnValueChanged

void OnValueChanged (Closure callback)

Bind a function to handle the event that is invoked when when a user has clicked one of the options in the dropdown list.

Parameter
Type
Description

SetValueByText

bool SetValueByText (string text)

Attempts to set the dropdown to the first option in the dropdown list that matches the inputted text. Returns true if found, false if no matches found.

Parameter
Type
Description

Properties

Interactable

bool Interactable get set

Is this UIDropdown interactable?

Template

SGameObject Template get set

The Rect Transform of the template for the dropdown list.

CaptionText

SUIText CaptionText get set

The Text component to hold the text of the currently selected option.

CaptionImage

SUIImage CaptionImage get set

The Image component to hold the image of the currently selected option.

ItemText

SUIText ItemText get set

The Text component to hold the text of the item.

ItemImage

SUIImage ItemImage get set

The Image component to hold the image of the item.

OptionsAsText

string[] OptionsAsText get

The list of possible options. (Text)

OptionsAsSprites

SResource[] OptionsAsSprites get

The list of possible options. (Sprites)

Value

int Value get set

The Value is the index number of the current selection in the Dropdown. 0 is the first option in the Dropdown, 1 is the second, and so on.

NormalColor

SColor NormalColor get set

Property Description

HighlightedColor

SColor HighlightedColor get set

Property Description

PressedColor

SColor PressedColor get set

Property Description

DisabledColor

SColor DisabledColor get set

Property Description

ColorMultiplier

float ColorMultiplier get set

Property Description

GameObject

SGameObject GameObject get

Property Description

SBrowserSurface

Index

Functions Index

Function Name

SCharacterController

Index

Functions Index

Function Name

SSeat

Index

Functions Index

Function Name

SUISlider

Index

Functions Index

Function Name
Space.Host.ExecutingObject.UIImage.Color= Color.Red
Space.Host.ExecutingObject.UIImage.Sprite = Space.GetResource("resource name")
Space.Host.ExecutingObject.UIImage.PreserveAspect = true 
Space.Host.ExecutingObject.UIImage.FillCenter = true
Space.Host.ExecutingObject.UIImage.FillAmount = 0.5
Space.Host.ExecutingObject.UIImage.FillClockwise = true
Space.Host.ExecutingObject.UIImage.FillOrigin = 0
Space.Host.ExecutingObject.UIImage.AlphaHitTestMinimumThreshold =  0
imgHasBorder = Space.Host.ExecutingObject.UIImage.HasBorder 
ppUnit = Space.Host.ExecutingObject.UIImage.PixelsPerUnit
Space.Host.ExecutingObject.UIImage.Material = Space.GetResource("resource name").AsMaterial
minWidth = Space.Host.ExecutingObject.UIImage.MinWidth
prefWidth = Space.Host.ExecutingObject.UIImage.PreferredWidth
flexWidth = Space.Host.ExecutingObject.UIImage.FlexibleWidth
minHeight = Space.Host.ExecutingObject.UIImage.MinHeight
prefHeight = Space.Host.ExecutingObject.UIImage.PreferredHeight
flexHeight = Space.Host.ExecutingObject.UIImage.FlexibleHeight
layoutPrio = Space.Host.ExecutingObject.UIImage.LayoutPriority
theGameObject = Space.Host.ExecutingObject.UIImage.GameObject
Space.Host.ExecutingObject.UIDropdown.RefreshShownValue()
Space.Host.ExecutingObject.UIDropdown.AddOptions({"option1","option2","option3"})
Space.Host.ExecutingObject.UIDropdown.ClearOptions()
Space.Host.ExecutingObject.UIDropdown.Show()
Space.Host.ExecutingObject.UIDropdown.Hide()
function AFunction()
--
end

Space.Host.ExecutingObject.UIDropdown.OnValueChanged(AFunction)
Space.Host.ExecutingObject.UIDropdown.SetValueByText("Value Text")
--Populating a UIDropdown and making a selection using value's text
dropDown=Space.Host.GetReference("DropDown").UIDropdown
options = {"Room 1", "Room 2", "Room 3", "Room 4"}
dropDown.AddOptions(options)
dropDown.SetValueByText("Room 3")
Space.Host.ExecutingObject.UIDropdown.Interactable = true
--clicking this object will toggle a UIDropdown's interactable status

thisGameObject = Space.Host.ExecutingObject
dropdown = Space.Host.GetReference("dropdown").UIDropdown 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
dropdown.Interactable =  not dropdown.Interactable
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
aReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.Template = aReferenceToAGameObject
captionText = Space.Host.ExecutingObject.UIDropdown.CaptionText
captionText.Text = "new caption"
aReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UIImage
aReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UIText
iaReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UIImage
optionsText = Space.Host.ExecutingObject.UIDropdown.OptionsAsText
optionsSprites = Space.Host.ExecutingObject.UIDropdown.OptionsAsSprites
Space.Host.ExecutingObject.UIDropdown.Value= 2
Space.Host.ExecutingObject.UIDropdown.NormalColor = Color.Red
Space.Host.ExecutingObject.UIDropdown.HighlightedColor = Color.Red
Space.Host.ExecutingObject.UIDropdown.PressedColor = Color.Red
Space.Host.ExecutingObject.UIDropdown.DisabledColor = Color.Red
Space.Host.ExecutingObject.UIDropdown.ColorMultiplier = Color.Red
Space.Host.ExecutingObject.UIDropdown.GameObject = Color.Red
MinWidth
PreferredWidth
FlexibleWidth
MinHeight
PreferredHeight
FlexibleHeight
LayoutPriority
GameObject

SColor NormalColor get set

SColor HighlightedColor get set

SColor PressedColor get set

SColor DisabledColor get set

float ColorMultiplier get set

SGameObject GameObject get

RefreshShownValue
AddOptions
AddOptions
AddOptions
ClearOptions
Show
Hide
OnValueChanged
Interactable
Template
CaptionText
CaptionImage
ItemText
ItemImage
OptionsAsText
OptionsAsSprites
Value

void (string url)

void ()

void ()

void ()

void (string name, Closure function)

void (string name, string argument)

void (Closure e)

Properties Index

Property Name

bool get set

bool get set

bool get

bool get

bool get set

float get set

Functions

SetURL

void SetURL (string url)

Sets the URL for the browser frame, and navigates to it.

Parameter
Type
Description

url

string

A standard URL recognized by Chromium, such as https://www.youtube.com.

Back

void Back ()

Equivalent to hitting the 'back' button within the browser.

Forward

void Forward ()

Equivalent to hitting the 'forward' button within the browser.

Reload

void Reload ()

Refreshes and reloads the current webpage.

RegisterFunction

void RegisterFunction (string name, Closure function)

Allows a JavaScript function that exists in the browser to be called by our code.

Parameter
Type
Description

name

string

The name of the JavaScript function we want to register. The function name should start with "sinespace__".

CallFunction

void CallFunction (string name, string argument)

Calls a JS function in the browser with a single argument. The function name must begin with the characters "sinespace_".

Parameter
Type
Description

OnURLChanged

void OnURLChanged (Closure e)

Binds a function to be called whenever the URL of the Browser Surface changes

Parameter
Type
Description

Properties

Networked

bool Networked get set

Should changes to this browser be streamed to other clients within the area?.

Muted

bool Muted get set

Whether this Browser Surface is muted or not.

CanGoBack

bool CanGoBack get

Returns whether this Browser Surface can navigate back

CanGoForward

bool CanGoForward get

Returns whether this Browser Surface can navigate forward

EnableInput

bool EnableInput get set

Whether this Browser Surface has Input enabled or not (interactable)

Zoom

float Zoom get set

Set the Zoom of the browser surface (Pixel Scaling). Positive values zoom in, negative values zoom out.

GameObject

SGameObject GameObject get

Returns a reference to the GameObject of this component.

SVector (SVector position)

SVector (SVector position)

bool (SVector speed)

int (SVector motion)

Properties Index

Property Name

SVector get set

bool get set

bool get set

float get set

float get set

float get set

float get set

float get set

float get set

Functions

ClosestPointOnBounds

SVector ClosestPointOnBounds (SVector position)

The closest point to the bounding box of the attached collider. This can be used to calculate hit points when applying explosion damage.

Parameter
Type
Description

ClosestPoint

SVector ClosestPoint (SVector position)

The point on the collider that is closest to the specified location.

Parameter
Type
Description

SimpleMove

bool SimpleMove (SVector speed)

Moves the character with speed. Velocity along the y-axis is ignored. Speed is in units/s. Gravity is automatically applied.

Returns if the character is grounded.

It is recommended that you make only one call to Move or SimpleMove per frame.

Parameter
Type
Description

Move

int Move (SVector motion)

Supplies the movement of a SGameObject with an attached SCharacterController component.

The SCharacterController.Move motion moves the SGameObject in the given direction. The given direction requires absolute movement delta values. A collision constrains the Move from taking place.

Returns an int indicating the direction of a collision: None (0), Sides (1), Above (2), and Below (3). SCharacterController.Move does not use gravity.

Parameter
Type
Description

Properties

Center

SVector Center get set

Returns Center Vector value of the Character Controller.

DetectCollisions

bool DetectCollisions get set

Determines whether other rigidbodies or character controllers collide with this character controller (by default this is always enabled).

This method does not affect collisions detected during the character controller's movement but rather decides whether an incoming collider will be blocked by the controller's collider. For example, a box collider in the Scene will block the movement of the controller, but the box may still fall through the controller if detectCollisions is false. This property is useful to disable the character controller temporarily. For example, you might want to mount a character into a car and disable collision detection until it exits the car again.

EnableOverlapRecovery

bool EnableOverlapRecovery get set

Enables or disables overlap recovery. Enables or disables overlap recovery. Used to depenetrate character controllers from static objects when an overlap is detected.

Overlap recovery can be used to depenetrate character controllers (CCTs) from static objects when an overlap is detected. This can happen in three main cases:

- when the CCT is directly spawned or teleported in another object

- when the CCT algorithm fails due to limited FPU accuracy

- when the "up vector" is modified, making the rotated CCT shape overlap surrounding objects

When activated, the CCT module will automatically try to resolve the penetration, and move the CCT to a safe place where it does

not overlap other objects anymore. This only concerns static objects, dynamic objects are ignored by overlap recovery.

When overlap recovery is not activated, it is possible for the CCTs to go through static objects. By default, overlap recovery is enabled.

Overlap recovery currently works with all geometries except heightfields.

Height

float Height get set

The height of the character's capsule.

MinMoveDistance

float MinMoveDistance get set

Gets or sets the minimum move distance of the character controller.

Radius

float Radius get set

The radius of the character's capsule.

SkinWidth

float SkinWidth get set

The character's collision skin width.

SlopeLimit

float SlopeLimit get set

The character controllers slope limit in degrees.

StepOffset

float StepOffset get set

The character controllers step offset in meters.

Velocity

SVector Velocity get

The current relative velocity of the Character.

GameObject

SGameObject GameObject get

Returns a reference to the GameObject of this component.

void ()

void ()

void (Closure e)

void (Closure e)

void (Closure e)

void (Closure e)

Properties Index

Property Name

bool get set

bool get

long get

bool get set

string get set

SCollider get set

SResource get set

SResource get set

SResource get set

Functions

SitPlayer

void SitPlayer ()

Make a player sit.

Parameter
Type
Description

UnseatPlayer

void UnseatPlayer ()

Make a player unseat.

Parameter
Type
Description

OnStandUp

void OnStandUp (Closure e)

Binds a function to the Seat's On Stand Up event

Parameter
Type
Description

OnSit

void OnSit (Closure e)

Binds a function to the Seat's On Sit event

Parameter
Type
Description

OnPlayerStandUp

void OnPlayerStandUp (Closure e)

Binds a function to the Seat's On Player Stand Up event which is fired only on the Player's client

Parameter
Type
Description

OnPlayerSit

void OnPlayerSit (Closure e)

Binds a function to the Seat's On Player Sit event which is fired only on the Player's client

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether the seat component is enabled.

InUse

bool InUse get

Return that whether the seat is in use.

PlayerSeated

long PlayerSeated get

Return the ID of the seating player.

UseSlotID

bool UseSlotID get set

Return true if uses SlotID

SlotID

string SlotID get set

Return the slot ID of the seat.

ClickableCollider

SCollider ClickableCollider get set

Return the clickable collider.

Animation

SResource Animation get set

Return the animation clip.

AnimationMale

SResource AnimationMale get set

No Description

AnimationFemale

SResource AnimationFemale get set

No Description

GameObject

SGameObject GameObject get

Property Description

void (Closure callback)

Properties Index

Property Name

bool get set

bool get set

int get set

float get set

float get set

bool get set

float get set

float get set

SColor get set

Functions

OnValueChanged

void OnValueChanged (Closure callback)

Callback executed when the value of the slider is changed.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether this Slider component is Enabled or not

Interactable

bool Interactable get set

Use to enable or disable the ability to interact with the slider.

Direction

int Direction get set

The direction of the slider (0 to 4). 0 Left To Right, 1 Right To Left, 2 Bottom To Top, 3 Top To Bottom

MinValue

float MinValue get set

The minimum allowed value of the slider.

MaxValue

float MaxValue get set

The maximum allowed value of the slider.

WholeNumbers

bool WholeNumbers get set

Should the value only be allowed to be whole numbers?

Value

float Value get set

The current value of the slider.

NormalizedValue

float NormalizedValue get set

The current value of the slider normalized into a value between 0 and 1.

NormalColor

SColor NormalColor get set

The normal color.

HighlightedColor

SColor HighlightedColor get set

The color of the control when it is highlighted.

PressedColor

SColor PressedColor get set

The color of the control when it is pressed.

DisabledColor

SColor DisabledColor get set

The color of the control when it is disabled.

ColorMultiplier

float ColorMultiplier get set

This multiplies the tint color for each transition by its value.

GameObject

SGameObject GameObject get

Property Description

SUIText

Index

Properties Index

Property Name
Space.Host.ExecutingObject.Browser.SetURL('https://www.youtube.com')
--the below scipt makes this object set Browser URL according to what's written in text field
--(Example: Set URL button)
--[Required: This object needs a Browser and InputField objects to be added as reference to references section in Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
webBrowser = Space.Host.GetReference("Browser")
urlField = Space.Host.GetReference("URL Field")

OnClick = function()

webBrowser.Browser.SetURL(urlField.UIInputField.Text)

end

urlField.UIInputField.Text = "https://www.youtube.com"
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to set URL"
thisGameObject.Clickable.OnClick(OnClick)  
Space.Host.ExecutingObject.Browser.Back()
--the below scipt makes this object a clickable that navigates Back
--(Example: Browser navigation )
--[Required: Browser surface object needs to be added as a reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
browser = Space.Host.GetReference("Browser Surface Object").Browser

OnClick = function()
browser.Back()
end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Enable/Disable browser Input"
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Browser.Forward()
--the below scipt makes this object a clickable that navigates Forward
--(Example: Browser navigation )
--[Required: Browser surface object needs to be added as a reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
browser = Space.Host.GetReference("Browser Surface Object").Browser

OnClick = function()
browser.Forward()
end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Enable/Disable browser Input"
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Browser.Reload()
 --the below scipt makes this object a clickable that reloads the page
--(Example: Browser navigation )
--[Required: Browser surface object needs to be added as a reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
browser = Space.Host.GetReference("Browser Surface Object").Browser

OnClick = function()
browser.Reload()
end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Enable/Disable browser Input"
thisGameObject.Clickable.OnClick(OnClick) 
Space.Host.ExecutingObject.Browser.RegisterFunction("sinespace__TestFunction", )
Space.Host.ExecutingObject.Browser.CallFunction()
Space.Host.ExecutingObject.Browser.OnURLChanged(aFunction)
--the below scipt makes this object clear the an InputField whenever URL changes
--(Example: URL Bar)
--[Required: This object needs a Browser and InputField objects to be added as reference to references section in Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
webBrowser = Space.Host.GetReference("Browser")
urlField = Space.Host.GetReference("URL Field")

OnURLChanged  ()

urlField.UIInputField.Text = " "

end

webBrowser.Browser.OnURLChanged(OnURLChanged)
Space.Host.ExecutingObject.Browser.Networked = true
 --the below scipt makes this object toggle Networking on it's parent browser
--(Example: browser controls)
--[Required: This object needs its parent to have the browser component]

thisGameObject = Space.Host.ExecutingObject

OnClick = function()

  if thisGameObject.Parent.Browser.Networked then
   thisGameObject.Parent.Browser.Networked = false
    Space.Log("Browser will not be networked")
  else
    thisGameObject.Parent.Browser.Networked = true
    Space.Log("Browser will be networked")
  end

end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to toggle Networking on Browser"
thisGameObject.Clickable.OnClick(OnClick)   
Space.Host.ExecutingObject.Browser.Muted=true
--the below scipt makes this object a clickable that mutes/unmutes a browser surface
--(Example: Browser Mute button )
--[Required: This object's parent needs to be an object with BrowserSurface component in it]

thisGameObject = Space.Host.ExecutingObject


OnClick = function()

  if thisGameObject.Parent.Browser.Muted then
   thisGameObject.Parent.Browser.Muted = false
    Space.Log("Browser unmuted")
  else
    thisGameObject.Parent.Browser.Muted = true
    Space.Log("Browser muted")
  end

end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Mute/Unmute Browser"
thisGameObject.Clickable.OnClick(OnClick)  
CanGoBack = Space.Host.ExecutingObject.Browser.CanGoBack
 --the below scipt makes this Browser object show/hide it's Forward and Back
--buttons according to wether the actions are possible or not
--(Example: browser navigation )
--[Required: This object needs the forward and back objects added to the references section in scripting runtime]

thisGameObject = Space.Host.ExecutingObject
forwardButton = Space.Host.GetReference("Forward Button")
backButton = Space.Host.GetReference("Back Button")

OnUpdate = function()
 
 if thisGameObject.Browser.CanGoBack then
   backButton.Active = true
  else backButton.Active = false
end

if thisGameObject.Browser.CanGoForward then
  forwardButton.Active = true
else forwardButton.Active = false
end

  
end

thisGameObject.OnUpdate(OnUpdate)
CanGoForward = Space.Host.ExecutingObject.Browser.CanGoForward
 --the below scipt makes this Browser object show/hide it's Forward and Back
--buttons according to wether the actions are possible or not
--(Example: browser navigation )
--[Required: This object needs the forward and back objects added to the references section in scripting runtime]

thisGameObject = Space.Host.ExecutingObject
forwardButton = Space.Host.GetReference("Forward Button")
backButton = Space.Host.GetReference("Back Button")

OnUpdate = function()
 
 if thisGameObject.Browser.CanGoBack then
   backButton.Active = true
  else backButton.Active = false
end

if thisGameObject.Browser.CanGoForward then
  forwardButton.Active = true
else forwardButton.Active = false
end

  
end

thisGameObject.OnUpdate(OnUpdate)
Space.Host.ExecutingObject.Browser.EnableInput = false
--the below scipt makes this object a clickable that toggle Enable Input a browser surface
--(Example: Brower Enable Input toggle button )
--[Required: Browser surface object needs to be added as a reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
browser = Space.Host.GetReference("Browser Surface Object").Browser

OnClick = function()

  if browser.EnableInput then
   browser.EnableInput = false
    Space.Log("Browser input disabled")
  else
    browser.EnableInput = true
    Space.Log("Browser input enabled")
  end

end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Enable/Disable browser Input"
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Browser.Zoom = 2
--the below scipt make a slider control the zoom in of a browser surface
--(Example: browser zoom controls)
--[Required: This object needs a Browser and slider objects to be added as reference to references section in Scripting Runtime component]
slider = Space.Host.GetReference("Slider").UISlider
browser = Space.Host.GetReference("Browser")

browser.Browser.SetURL("https://www.yahoo.com")


OnValueChanged = function()
browser.Browser.Zoom = slider.NormalizedValue * 5
end

slider.OnValueChanged(OnValueChanged)
theGameObject = Space.Host.ExecutingObject.Browser.GameObject
closestPoint = Space.Host.ExecutingObject.CharacterController.ClosestPointOnBounds(Vector.New(0,0,0))
closestPoint = Space.Host.ExecutingObject.CharacterController.ClosestPoint = Vector.New(0,0,0)
isGrounded = Space.Host.ExecutingObject.CharacterController.SimpleMove = Vector.New(100,0,0)
collisionDirection = Space.Host.ExecutingObject.CharacterController.Move = Vector.New(100,0,0)
Space.Host.ExecutingObject.CharacterController.Center = Vector.New(0,0,0) 
Space.Host.CharacterController.DetectCollisions= false
--clicking this object will toggle a Character Controller's Detect Collisions property

thisObject = Space.Host.ExecutingObject
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController --add Reference to Scripting Runtime


function OnClickFunction()
ccontroller.DetectCollisions = not ccontroller.DetectCollisions
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.CharacterController.EnableOverlapRecovery= false
--clicking this object will toggle a Character Controller's Enable Overlap Recovery property

thisObject = Space.Host.ExecutingObject
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController --add Reference to Scripting Runtime


function OnClickFunction()
ccontroller.EnableOverlapRecovery = not ccontroller.EnableOverlapRecovery
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.CharacterController.Height = 4
--the below script will make a slider change a Character Controller Height property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider 
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController 


OVC = function()
ccontroller.Height = (slider.Value * 10.0) -- from 0.0 to 10.0
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.CharacterController.MinMoveDistance = 3
--this script will make a slider change a Character Controller Min Move Distance property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider 
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController 


OVC = function()
ccontroller.MinMoveDistance= (slider.Value * 10.0) -- from 0.0 to 10.0
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.CharacterController.Radius = 5
--this script will make a slider change a Character Controller Radius property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider 
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController 


OVC = function()
ccontroller.Radius= (slider.Value * 10.0) -- from 0.0 to 10.0
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.CharacterController.SkinWidth = 4
--this script will make a slider change a Character Controller SkinWidth property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider 
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController 


OVC = function()
ccontroller.SkinWidth= (slider.Value * 10.0) -- from 0.0 to 10.0
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.CharacterController.SlopeLimit= 2
--this script will make a slider change a Character Controller Slope Limit property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider 
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController 


OVC = function()
ccontroller.SlopeLimit= (slider.Value * 180.0) -- from 0.0 to 180.0
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.CharacterController.StepOffset= 2
--this script will make a slider change a Character Controller Step Offset property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider 
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController 


OVC = function()
ccontroller.StepOffset= (slider.Value * 10.0) -- from 0.0 to 10.0
end

slider.OnValueChanged(OVC)
currentRelativeVelocity = Space.Host.ExecutingObject.CharacterController.Velocity
theGameObject = Space.Host.ExecutingObject.CharacterController.GameObject
Space.Host.ExecutingObject.Seat.SitPlayer()
Space.Host.ExecutingObject.Seat.UnseatPlayer()
e = function()
Space.Log("On Stand Up event")
end

Space.Host.ExecutingObject.Seat.OnStandUp(e)
e = function()
Space.Log("On Sit event")
end

Space.Host.ExecutingObject.Seat.OnSit(e)
e = function()
Space.Log("On Player Stand Up")
end

Space.Host.ExecutingObject.Seat.OnPlayerStandUp(e)
--the below script will teleport the player above the seat after standing up
--so that they do not go back to original position, but rather be standing next to the seat
--(Example: if the seat moves - such as in a vehicle- and we want to stand up next to it)
--[Requires Seat Component in the GameObject running this script]

thisGameObject = Space.Host.ExecutingObject

OnPlayerStandUp = function()
seatPosition = thisGameObject.WorldPosition
teleportPosition = Vector.New(seatPosition.X, seatPosition.Y + 1, seatPosition.Z)
Space.Scene.PlayerAvatar.Teleport(teleportPosition)
end

thisGameObject.Seat.OnPlayerStandUp(OnPlayerStandUp)
e = function()
Space.Log("On Player Sit event")
end

Space.Host.ExecutingObject.Seat.OnPlayerSit(e)
--the below script will check if the player sitting is the owner of the seat
--if they are not, we will remove them from the seat
--(Example: if the seat is a vehicle which the owner wants no one else to use)
--[Requires Seat Component in the GameObject running this script]
--<Note: ID match may not succeed in Editor but will succeed in SS client>

thisGameObject = Space.Host.ExecutingObject

OnPlayerSit = function()
  if Space.Scene.PlayerAvatar.ID ~= thisGameObject.Owner then
    thisGameObject.Seat.UnseatPlayer()
    Space.Log("You do not have permission to sit in this vehicle")
  end
  
end

thisGameObject.Seat.OnPlayerSit(OnPlayerSit)
= seatIsEnabled = Space.Host.ExecutingObject.Seat.Enabled
--clicking this object will Enable/Disable it's Seat component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Seat

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
seatIsInUse = Space.Host.ExecutingObject.Seat.InUse
 --this script will play a looping sound only if someone is using the seat
 --and will stop the sound if someone is not
--(Example: carnival game )
--[Object must contain a Seat component and AudioSource component]

thisGameObject = Space.Host.ExecutingObject


OnUpdate = function()
  if thisGameObject.Seat.InUse then
        if not thisGameObject.Audio.IsPlaying then
        thisGameObject.Audio.Play()
        end
  else
       if thisGameObject.Audio.IsPlaying then
        thisGameObject.Audio.Stop()
        end
  end
end

thisGameObject.Audio.Loop = true
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate) 
player = Space.Host.ExecutingObject.Seat.PlayerSeated
Space.Host.ExecutingObject.Seat.UseSlotID = false
seatSlotID = Space.Host.ExecutingObject.Seat.SlotID
seatClickableCollider = Space.Host.ExecutingObject.Seat.ClickableCollider
Space.Host.ExecutingObject.Seat.Animation = Space.GetResource("ResourceName")
--the below script will toggle between two seat animations every 30 seconds
--(Example: a couch where the player sitting periodically changes pose)
--[Requires Seat Component in the GameObject running this script]
--[Requires adding 2 animations as "Resources" at the bottom of the Scripting Runtime Component]

thisGameObject = Space.Host.ExecutingObject

anim1 = Space.GetResource("anim1")
anim2 = Space.GetResource("anim2")

thisGameObject.Seat.Animation = anim1
animIndex = 1


AnimationAlternate = function()
  while true do
    Space.Log(thisGameObject.Seat.Animation)
       if animIndex == 1 then
         thisGameObject.Seat.Animation = anim2
         animIndex = 2
        else
          thisGameObject.Seat.Animation = anim1
          animIndex = 1
        end
    
    
    -- next part unseats then seats the player to reflect animation change (its too fast to notice)
    -- we also make sure we are running this part on the specific player sitting (if any), not everyone else
   if thisGameObject.Seat.InUse then 
      if thisGameObject.Seat.PlayerSeated == Space.Scene.PlayerAvatar.ID then
       thisGameObject.Seat.UnseatPlayer()
       thisGameObject.Seat.SitPlayer()
      end
    end
        
     
    Space.Log("yielding") 
    coroutine.yield(5)
    
  end
  
  
  
end

Space.Host.StartCoroutine(AnimationAlternate)
Space.Host.ExecutingObject.Seat.AnimationMale = Space.GetResource("ResourceName")
Space.Host.ExecutingObject.Seat.AnimationFemale = Space.GetResource("ResourceName")
theGameObject = Space.Host.ExecutingObject.Seat.GameObject
function ValueChanged()
--
end

Space.Host.ExecutingObject.UISlider.OnValueChanged(ValueChanged)
--This script will make moving a slider control the Master Volume
--and also update a text field with the current Master Volume
--[You need to add the slider and text field as a reference]

slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText


OnValueChanged = function()
Space.UI.MasterVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.MasterVolume
end

slider.OnValueChanged(OnValueChanged)
Space.Host.ExecutingObject.UISlider.Enabled = false 
--clicking this object will toggle a Sliders's Enabled status

thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
slider.Enabled =  not slider.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UISlider.Interactable = true
--clicking this object will toggle a Sliders's Interactable status

thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
slider.Interactable =  not slider.Interactable
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UISlider.Direction = 1
Space.Host.ExecutingObject.UISlider.MinValue = 10
Space.Host.ExecutingObject.UISlider.MaxValue = 20
Space.Host.ExecutingObject.UISlider.WholeNumbers = true
--clicking this object will toggle a Sliders's Whole Numbers status

thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
slider.WholeNumbers =  not slider.WholeNumbers
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UISlider.Value = 20
Space.Host.ExecutingObject.UISlider.NormalizedValue = 0.5
--This script will make moving a slider control the Master Volume
--and also update a text field with the current Master Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]

slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText


OnValueChanged = function()
Space.UI.MasterVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.MasterVolume
end

slider.OnValueChanged(OnValueChanged)
Space.Host.ExecutingObject.UISlider.NormalColor = Color.Red
Space.Host.ExecutingObject.UISlider.HighlightedColor = Color.Red
Space.Host.ExecutingObject.UISlider.PressedColor = Color.Red
lSpace.Host.ExecutingObject.UISlider.DisabledColor = Color.Red
Space.Host.ExecutingObject.UISlider.ColorMultiplier = 1.2
theGameObject = Space.Host.ExecutingObject.UISlider.GameObject
SetURL
Back
Forward
Reload
RegisterFunction
CallFunction
OnURLChanged
Networked
Muted
CanGoBack
CanGoForward
EnableInput
Zoom

SVector Velocity get

ClosestPointOnBounds
ClosestPoint
SimpleMove
Move
Center
DetectCollisions
EnableOverlapRecovery
Height
MinMoveDistance
Radius
SkinWidth
SlopeLimit
StepOffset

SGameObject GameObject get

SitPlayer
UnseatPlayer
OnStandUp
OnSit
OnPlayerStandUp
OnPlayerSit
Enabled
InUse
PlayerSeated
UseSlotID
SlotID
ClickableCollider
Animation
AnimationMale
AnimationFemale

SColor HighlightedColor get set

SColor PressedColor get set

SColor DisabledColor get set

float ColorMultiplier get set

SGameObject GameObject get

OnValueChanged
Enabled
Interactable
Direction
MinValue
MaxValue
WholeNumbers
Value
NormalizedValue
NormalColor

bool get set

bool get set

int get set

int get set

bool get set

int get set

float get set

float get

float get

float get

float get

Properties

SupportRichText

bool SupportRichText get set

Whether this Text will support rich text.

ResizeTextForBestFit

bool ResizeTextForBestFit get set

Should the text be allowed to auto resized.

ResizeTextMinSize

int ResizeTextMinSize get set

The minimum size the text is allowed to be.

ResizeTextMaxSize

int ResizeTextMaxSize get set

The maximum size the text is allowed to be.

AlignByGeometry

bool AlignByGeometry get set

Use the range of glyph geometry to perform horizontal alignment.

FontSize

int FontSize get set

The size that the Font should render at.

LineSpacing

float LineSpacing get set

How much space will be in-between lines of text. This is a multiplier. The line spacing value set will be multiplied by the font's internal line spacing. A value of 1 will produce normal line spacing.

PixelsPerUnit

float PixelsPerUnit get

Provides information about how fonts are scale to the screen.

For dynamic fonts, the value is equivalent to the scale factor of the canvas. For non-dynamic fonts, the value is calculated from the requested text size and the size from the font.

MinWidth

float MinWidth get

The minimum width this UIText may be allocated. (Used by the Layout system).

PreferredWidth

float PreferredWidth get

The preferred width this UIText should be allocated if there is sufficient space. (Used by the Layout system)

FlexibleWidth

float FlexibleWidth get

The extra relative width this UIText should be allocated if there is additional available space. (Used by the Layout system)

MinHeight

float MinHeight get

The minimum height this UIText may be allocated.(Used by the Layout system).

PreferredHeight

float PreferredHeight get

The preferred height this UIText should be allocated if there is sufficient space. (Used by the Layout system)

FlexibleHeight

float FlexibleHeight get

The extra relative height this UIText should be allocated if there is additional available space. (Used by the Layout system.)

LayoutPriority

int LayoutPriority get

The layout priority of this UIText component.(Used by the Layout system.)

Enabled

bool Enabled get set

Whether the UIText component is Enabled or not will decide if it is visually updating or not.

Text

string Text get set

The string value this Text displays.

Color

SColor Color get set

Base color of the Graphic.

GameObject

SGameObject GameObject get

Property Description

SUIInputField

Index

Functions Index

Function Name
 Space.Host.ExecutingObject.UIText.SupportRichText = true 
--the below script will make a UIToggle disable/enable Rich Text support in the UIText
--[Add "toggle" and "text" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

toggle = Space.Host.GetReference("toggle").UIToggle 
text = Space.Host.GetReference("text").UIText 
text.Text = "<b> Bold Test </b>"
OVC = function()
  if toggle.IsOn then
    text.SupportRichText = true
  else
    text.SupportRichText = false
  end
end

toggle.OnValueChanged(OVC)
 Space.Host.ExecutingObject.UIText.ResizeTextForBestFit = false 
--the below script will make a UIToggle disable/enable the Best Fit feature in the UIText
--[Add "toggle" and "text" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

toggle = Space.Host.GetReference("toggle").UIToggle 
text = Space.Host.GetReference("text").UIText 
text.Text = "A very long text a very long text a very long text a very long text"
OVC = function()
  if toggle.IsOn then
    text.ResizeTextForBestFit = true
  else
    text.ResizeTextForBestFit = false
  end
end

toggle.OnValueChanged(OVC)
Space.Host.ExecutingObject.UIText.ResizeTextMinSize = 20
--the below script will make a slider change the UIText's Best Fit Min Size
--[Add "slider" and "text" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
text = Space.Host.GetReference("text").UIText 
text.Text = "Best Fit Min Size"
text.ResizeTextForBestFit = true

OVC = function()
text.ResizeTextMinSize  = (slider.Value * 20) + 10 -- from 10 to 30
end

slider.OnValueChanged(OVC) 
 Space.Host.ExecutingObject.UIText.ResizeTextMaxSize = 150
--the below script will make a slider change the UIText's Best Fit Max Size
--[Add "slider" and "text" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
text = Space.Host.GetReference("text").UIText 
text.Text = "Best Fit Max Size"
text.ResizeTextForBestFit = true

OVC = function()
text.ResizeTextMaxSize  = (slider.Value * 50) + 20 -- from 50 to 70
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.UIText.AlignByGeometry = true
--the below script will make a UIToggle disable/enable the Align By Geometry feature in the UIText
--[Add "toggle" and "text" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

toggle = Space.Host.GetReference("toggle").UIToggle 
text = Space.Host.GetReference("text").UIText 
text.Text = "Align By Geometry"
OVC = function()
  if toggle.IsOn then
    text.AlignByGeometry  = true
  else
    text.AlignByGeometry  = false
  end
end

toggle.OnValueChanged(OVC)
Space.Host.ExecutingObject.UIText.FontSize = 54
--the below script will make a slider change the UIText's Font Size
--[Add "slider" and "text" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
text = Space.Host.GetReference("text").UIText 
text.Text = "Text Size Test"

OVC = function()
text.FontSize  = (slider.Value * 40) + 10 -- from 10 to 50
end

slider.OnValueChanged(OVC)
thisObject = Space.Host.ExecutingObject.UIText.LineSpacing = 2
--the below script will make a slider change the UIText's Line Spacing
--[Add "slider" and "text" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
text = Space.Host.GetReference("text").UIText 
text.Text = "Line Spacing Line Spacing Line Spacing Line Spacing Line Spacing"

OVC = function()
text.LineSpacing  = (slider.Value * 2) -- from 0 to 2
end

slider.OnValueChanged(OVC) 
thisObject = Space.Host.ExecutingObject
 --get a reference to our object
thisObjectText = thisObject.UIText
 --get a reference to the UIText component in our object 

Space.Log(thisObjectText.PixelsPerUnit)
--Prints the PixelsPerUnit value of this UIText component to the console
thisObject = Space.Host.ExecutingObject
 --get a reference to our object
thisObjectText = thisObject.UIText
 --get a reference to the UIText component in our object 
 
Space.Log(thisObjectText.MinWidth)
--Prints the MinWidth value of this UIText component to the console
pWidth = Space.Host.ExecutingObject.UIText.PreferredWidth
FlexibleWidth = Space.Host.ExecutingObject.UIText.FlexibleWidth 
minHeight = Space.Host.ExecutingObject.UIText.MinHeight
pHeight = Space.Host.ExecutingObject.UIText.PreferredHeight
FlexibleHeight = Space.Host.ExecutingObject.UIText.FlexibleHeight
layoutPriority = Space.Host.ExecutingObject.UIText.LayoutPriority
 Space.Host.ExecutingObject.UIText.Enabled = true
--this below script will make clicking this object disable/enable a UIText component

thisGameObject = Space.Host.ExecutingObject

text = Space.Host.GetReference("text").UIText
 
OnClick = function()

  if text.Enabled then
    text.Enabled = false
  else
    text.Enabled = true
  end
  
end

thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "click to hide/show text"
thisGameObject.Clickable.OnClick(OnClick)
 Space.Host.ExecutingObject.UIText.Text = "Hello World!" 
--the below script will make a UIText element with this script
--constantly update itself to show the local time
--(Example: UI Text element that shows local clock)
--[This object needs to be a UI Text object. In Unity, Heirarchy -> Create -> UI -> Text]
--<Note: UI Text element could also be in world space if it's canvas is a world space canvas>

thisGameObject = Space.Host.ExecutingObject

OnUpdate = function()
thisGameObject.UIText.Text = Space.LocalTime
end

thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
Space.Host.ExecutingObject.UIText.Color = Color.Red
--This script dynamically changes the text's color of a GameObject with UIText component.
--For example in a text sign over your shop that you want to make more visually stand out
--or perhaps text decoration during a celebration or a text element in your User Interface or HUD.

thisObject = Space.Host.ExecutingObject
 --get a reference to our object
thisObjectText = thisObject.UIText
 --get a reference to the SUIText component in our object 
colors = {Color.Red, Color.Black, Color.White, Color.Blue, Color.Green, Color.Yellow}
 --here we are holding 6 predefined colors in a Lua Table which we will go through


function ColorChanger()

    while true do
    --infinite loop
    
        for i=1,#colors do
        --For Loop to cycle through all the table items
        thisObjectText.color = colors[i] 
        --this will set the color based on which item in the table we are now at
        coroutine.yield(0.1)
        --this will pause for a tenth of a second before we change to the next color
        end

    end
end


Space.Host.StartCoroutine(ColorChanger) 
--this coroutine will now call our ColorChanger() function which is infinitely changing our text colors between a select range. 
theGameObject = Space.Host.ExecutingObject.UIText.Text

float MinHeight get

float PreferredHeight get

float FlexibleHeight get

int LayoutPriority get

bool Enabled get set

string Text get set

SColor Color get set

SGameObject GameObject get

SupportRichText
ResizeTextForBestFit
ResizeTextMinSize
ResizeTextMaxSize
AlignByGeometry
FontSize
LineSpacing
PixelsPerUnit
MinWidth
PreferredWidth
FlexibleWidth

void (Closure callback)

void (Closure callback)

void ()

void ()

void ()

Properties Index

Property Name

string get set

bool get set

bool get set

bool get

float get set

int get set

int get set

bool get set

bool get

Functions

OnValueChanged

void OnValueChanged (Closure callback)

Given function will be called when text in Input Field has changed

Parameter
Type
Description

OnEndEdit

void OnEndEdit (Closure callback)

Given function will be called when editing has ended

Parameter
Type
Description

ActivateInputField

void ActivateInputField ()

Function Description

DeactivateInputField

void DeactivateInputField ()

Function Description

Select

void Select ()

Function Description

Properties

Text

string Text get set

The current value of the input field.

Enabled

bool Enabled get set

Whether this Input Field component is Enabled

Interactable

bool Interactable get set

Is the Input Field interactable?

IsFocused

bool IsFocused get

Does the InputField currently have focus and is able to process events.

CaretBlinkRate

float CaretBlinkRate get set

The blinking rate of the input caret, defined as the number of times the blink cycle occurs per second.

CaretWidth

int CaretWidth get set

The width of the caret in pixels.

CharacterLimit

int CharacterLimit get set

Property Description

ReadOnly

bool ReadOnly get set

Property Description

MultiLine

bool MultiLine get

If the input field supports multiple lines.

AsteriskChar

char AsteriskChar get set

The character used for password fields.

CaretPosition

int CaretPosition get set

Current InputField caret position (also selection tail).

SelectionAnchorPosition

int SelectionAnchorPosition get set

The beginning point of the selection.

SelectionFocusPosition

int SelectionFocusPosition get set

The end point of the selection.

MinWidth

float MinWidth get

The minimum width this UIInputField may be allocated. (Used by the Layout system).

PreferredWidth

float PreferredWidth get

The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)

FlexibleWidth

float FlexibleWidth get

The extra relative width this UIInputField should be allocated if there is additional available space. (Used by the Layout system)

MinHeight

float MinHeight get

The minimum height this UIInputField may be allocated.(Used by the Layout system).

PreferredHeight

float PreferredHeight get

The preferred height this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)

FlexibleHeight

float FlexibleHeight get

The extra relative height this UIInputField should be allocated if there is additional available space. (Used by the Layout system)

NormalColor

SColor NormalColor get set

The normal color.

HighlightedColor

SColor HighlightedColor get set

The color of the control when it is highlighted.

PressedColor

SColor PressedColor get set

The color of the control when it is pressed.

DisabledColor

SColor DisabledColor get set

The color of the control when it is disabled.

ColorMultiplier

float ColorMultiplier get set

This multiplies the tint color for each transition by its value.

GameObject

SGameObject GameObject get

Property Description

SAudioSource

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

Play

void Play ()

Starts playing the audio clip.

Stop

void Stop ()

Stops playing the audio clip.

Pause

void Pause ()

Pauses the audio clip.

UnPause

void UnPause ()

Pauses the audio clip.

PlayOneShot

void PlayOneShot ( clip, float volume)

Plays the audio clip just ones at a desired volume.

Parameter
Type
Description

PlayClipAtPoint

void PlayClipAtPoint ( clip, position, float volume=1f)

Function Description

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Is the Audio Source component enabled?

Loop

bool Loop get set

Is looping of the sound clip enabled?

DopplerLevel

float DopplerLevel get set

The Doppler level of the Audio Source. (See: Doppler Effect)

Volume

float Volume get set

The Volume level of the Audio Source.

Pitch

float Pitch get set

The Pitch level for the Audio Source.

Time

float Time get set

Playback position in seconds.

TimeSamples

int TimeSamples get set

Playback position in PCM samples.

Length

float Length get

Return Audio Length.

Samples

int Samples get

Return Audio Samples.

IsPlaying

bool IsPlaying get

Is the sound clip playing right now?

PanStereo

float PanStereo get set

Pans the sound to the left or right. Values range from -1 to 1: 0 is the middle, -1 is full left, 1 is full right.

SpatialBlend

float SpatialBlend get set

The level of impact 3D effects make on the AudioSource. 0 - no impact (full 2D sound), 1 - maximum impact (full 3D sound).

Spatialize

bool Spatialize get set

Is spatialization enabled?

SpatializePostEffects

bool SpatializePostEffects get set

Is spatialization enabled before or after other filters are in action?

ReverbZoneMix

float ReverbZoneMix get set

The level at which the audio coming from this Audio Source will be mixed into the global reverb of the scene (accomplished with Reverb Zones).

BypassEffects

bool BypassEffects get set

When true, none of global sound effects (reverbs, filters, etc.) are applied to the audio from this Audio Source.

BypassListenerEffects

bool BypassListenerEffects get set

When true, whichever global effects are set on the Audio Listener will not be applied to the audio from this Audio Source.

BypassReverbZones

bool BypassReverbZones get set

When true, the audio from this Audio Source is not mixed into the global reverb generated through Reverb Zones.

Spread

float Spread get set

The angle of spread of the audio channels in the 3D space (only works for stereo and multichannel audio). 0 by default - all channels are concentrated at the same speaker location, making it "mono".

Priority

int Priority get set

The priority of this Audio Source: when there are more Audio Sources playing than channels available, Priority defines which channels will be discarded in favour of those with a higher priority. 0 is the highest priority, 255 - the lowest.

Mute

bool Mute get set

Is the audio muted? If True, the Volume is set to 0. If False, the Volume is restored to the original level.

MinDistance

float MinDistance get set

At which distance from the Audio Source the sound will begin ceasing? The sound will be heard at its maximum volume within this distance. (Spatial Blend should not be equal to 0 for this property to take effect.)

MaxDistance

float MaxDistance get set

At which distance from the Audio Source the sound will no longer be heard? (Spatial Blend should not be equal to 0 for this property to take effect.)

AudioClip

AudioClip get set

The audio clip that is or will be played by this Audio Source.

GameObject

GameObject get

Returns a reference to the GameObject of this component.

SNavMeshAgent

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

GetAreaCost

float GetAreaCost (int areaIndex)

Function Description

Parameter
Type
Description

Move

void Move ( movement)

Apply relative movement to current position.

Parameter
Type
Description

Resume

void Resume ()

Resume the NavMesh agent.

SetAreaCost

void SetAreaCost (int areaIndex, float cost)

Sets the cost for traversing over areas of the area type.

Parameter
Type
Description

Stop

void Stop ()

To stop the NavMesh agent.

SetDestination

void SetDestination ( position)

Set or update the destination.

Parameter
Type
Description

Warp

void Warp ( position)

Warp to the position you want, also you can set agent's world position and vector to make this act as Move(SVector position).

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Enable or disable this component.

Accelleration

float Accelleration get set

The maximum acceleration of an agent as it follows a path.

AngularSpeed

float AngularSpeed get set

Maximum turning speed in while following a path.

AreaMask

int AreaMask get set

Specifies which NavMesh area is passable.

AutoRepath

bool AutoRepath get set

Set the agent attempt to acquire a new path if the existing path becomes invalid.

AutoBraking

bool AutoBraking get set

Set the agent brake automatically to avoid overshooting the destination point.

AutoTraverseOffMeshLink

bool AutoTraverseOffMeshLink get set

Set the agent move across OffMeshLinks automatically.

AvoidancePriority

int AvoidancePriority get set

The avoidance priority level.

BaseOffset

float BaseOffset get set

The relative vertical displacement of the GameObject.

DesiredVelocity

DesiredVelocity get

The desired velocity of the agent including any potential contribution from avoidance.

Destination

Destination get set

The desired velocity of the agent including any potential contribution from avoidance.

HasPath

bool HasPath get

Does the agent currently have a path?

Height

float Height get set

The height of the agent for purposes of passing under obstacles, etc.

IsOnNavMesh

bool IsOnNavMesh get

Is the agent currently bound to the navmesh?

IsOnOffMeshLink

bool IsOnOffMeshLink get

Is the agent currently positioned on an OffMeshLink?

IsPathStale

bool IsPathStale get

Is the current path stale?

NextPosition

NextPosition get set

Get or set the simulation position of the navmesh agent.

PathEndPosition

PathEndPosition get

End positon of navigation.

PathPending

bool PathPending get

Is a path in the process of being computed but not yet ready?

Radius

float Radius get set

The avoidance radius for the agent.

RemainingDistance

float RemainingDistance get

The distance between the agent's position and the destination on the current path.

Speed

float Speed get set

Maximum movement speed when following a path.

SteeringTarget

SteeringTarget get

Get the current steering target along the path.

StoppingDistance

float StoppingDistance get set

Stop within this distance from the target position.

UpdatePosition

bool UpdatePosition get set

Get or set whether the transform position is synchronized with the simulated agent position.

UpdateRotation

bool UpdateRotation get set

Should the agent update the transform orientation?

Velocity

Velocity get

access the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually.

GameObject

GameObject get

Property Description

function OVC()
--
end
Space.Host.ExecutingObject.UIInputField.OnValueChanged(OVC)
--This script will make an input field update a text field 
--with character count in real-time every time a character is typed/removed
--[Text field and Input fields need to be added as references (scripting runtime)]

thisObject = Space.Host.ExecutingObject
inputField = Space.Host.GetReference("The Input Field").UIInputField
textField = Space.Host.GetReference("The Text Field").UIText

OnValueChanged = function()
 textField.Text =  "Count= " .. string.len(inputField.Text)
end

thisObject.UIInputField.OnValueChanged(OnValueChanged)
function OEE()
--
end
Space.Host.ExecutingObject.UIInputField.OnEndEdit(OEE)
--This script will make an input field update a text field 
--as soon as someone has finished typing in it
--Text field and Input fields need to be added as references (scripting runtime)

thisObject = Space.Host.ExecutingObject
inputField = Space.Host.GetReference("The Input Field").UIInputField
textField = Space.Host.GetReference("The Text Field").UIText

OnEndEdit = function()
 textField.Text = inputField.Text
end

Space.Host.ExecutingObject.UIInputField.OnEndEdit(OnEndEdit)
Space.Host.ExecutingObject.UIInputField.ActivateInputField()
Space.Host.ExecutingObject.UIInputField.DeactivateInputField()
Space.Host.ExecutingObject.UIInputField.DeactivateInputField()
Space.Host.ExecutingObject.UIInputField.Text= "Hello"
--the below script makes this object set Browser URL according to what's written in text field
--[Required: This object needs a Browser and InputField objects to be added as reference to references section in Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
webBrowser = Space.Host.GetReference("Browser")
urlField = Space.Host.GetReference("URL Field")

OnClick = function()

webBrowser.Browser.SetURL = urlField.UIInputField.Text

end

urlField.UIInputField.Text = https://www.youtube.com
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to set URL"
thisGameObject.Clickable.OnClick(OnClick)  
Space.Host.ExecutingObject.UIInputField.Enabled= true
--clicking this object will toggle a UIInputField's Enabled status

thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
inputfield.Enabled =  not inputfield.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UIInputField.Interactable= true
--clicking this object will toggle a UIInputField's interactable status
thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField 
--make sure to add this reference to the Scripting Runtime component



OnClick = function()
inputfield.Interactable =  not inputfield.Interactable
end



thisGameObject.AddClickable()


thisGameObject.Clickable.OnClick(OnClick)
hasFocus = Space.Host.ExecutingObject.UIInputField.IsFocused 
Space.Host.ExecutingObject.UIInputField.CaretBlinkRate= 3
Space.Host.ExecutingObject.UIInputField.CaretWidth= 4
Space.Host.ExecutingObject.UIInputField.CharacterLimit= 8
Is the InputField read only?
--clicking this object will toggle a UIInputField's ReadOnly status

thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
inputfield.ReadOnly =  not inputfield.ReadOnly
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.UIInputField.MultiLine = true
Space.Host.ExecutingObject.UIInputField.AsteriskChar= "%"
Space.Host.ExecutingObject.UIInputField.CaretPosition= 3
Space.Host.ExecutingObject.UIInputField.SelectionAnchorPosition= 1
Space.Host.ExecutingObject.UIInputField.SelectionFocusPosition= 4
minWidth = Space.Host.ExecutingObject.UIInputField.MinWidth
prefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidth
flexWidth = Space.Host.ExecutingObject.UIInputField.FlexibleWidth
minHeight = Space.Host.ExecutingObject.UIInputField.MinHeight
prefHeight = Space.Host.ExecutingObject.UIInputField.PreferredHeight
flexHeight = Space.Host.ExecutingObject.UIInputField.FlexibleHeight
Space.Host.ExecutingObject.UIInputField.NormalColor = Color.Red
Space.Host.ExecutingObject.UIInputField.HighlightedColor = Color.Red
Space.Host.ExecutingObject.UIInputField.PressedColor = Color.Red
Space.Host.ExecutingObject.UIInputField.DisabledColor = Color.Red
Space.Host.ExecutingObject.UIInputField.ColorMultiplier = Color.Red
theGameObject = Space.Host.ExecutingObject.UIInputField.GameObject

char AsteriskChar get set

int CaretPosition get set

int SelectionAnchorPosition get set

int SelectionFocusPosition get set

float MinWidth get

float PreferredWidth get

float FlexibleWidth get

float MinHeight get

float PreferredHeight get

float FlexibleHeight get

SColor NormalColor get set

SColor HighlightedColor get set

SColor PressedColor get set

SColor DisabledColor get set

float ColorMultiplier get set

SGameObject GameObject get

OnValueChanged
OnEndEdit
ActivateInputField
DeactivateInputField
Select
Text
Enabled
Interactable
IsFocused
CaretBlinkRate
CaretWidth
CharacterLimit
ReadOnly
MultiLine

float get set

float get set

bool get set

bool get set

float get set

bool get set

bool get set

bool get set

float get set

int get set

bool get set

float get set

float get set

SResource get set

void Play ()

void Stop ()

void Pause ()

void UnPause ()

void PlayOneShot (SResource clip, float volume)

void PlayClipAtPoint (SResource clip, SVector position, float volume=1f)

bool Enabled get set

bool Loop get set

float DopplerLevel get set

float Volume get set

float Pitch get set

float Time get set

int TimeSamples get set

float Length get

int Samples get

SResource
SResource
SVector
SResource
SGameObject

bool get

SVector get set

bool get

float get set

bool get

bool get

bool get

SVector get set

SVector get

bool get

float get set

float get

float get set

SVector get

float get set

bool get set

bool get set

SVector get

SGameObject get

float GetAreaCost (int areaIndex)

void Move (SVector movement)

void Resume ()

void SetAreaCost (int areaIndex, float cost)

void Stop ()

void SetDestination (SVector position)

void Warp (SVector position)

bool Enabled get set

float Accelleration get set

float AngularSpeed get set

int AreaMask get set

bool AutoRepath get set

bool AutoBraking get set

bool AutoTraverseOffMeshLink get set

int AvoidancePriority get set

float BaseOffset get set

SVector
SVector
SVector
SVector
SVector
SVector
SVector
SVector
SVector
SGameObject

SVector get

Space.Host.ExecutingObject.Audio.Play()
-- For example, we have a short chime that we want to play every time a new avatar joins the scene.
hostObject = Space.Host.ExecutingObject

function welcomeSound ()
hostObject.Audio.Play()
end

Space.Scene.OnPlayerJoin(welcomeSound)
Space.Host.ExecutingObject.Audio.Stop()
hostObject = Space.Host.ExecutingObject;

function audioOnOff ()
if hostObject.Audio.IsPlaying then
hostObject.Audio.Stop();
else
hostObject.Audio.Play();
end
Space.Log(hostObject.Audio.IsPlaying);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(audioOnOff);
-- Now, we can make the sound play or stop playing just by clicking the object.
Space.Host.ExecutingObject.Audio.Pause()
hostObject = Space.Host.ExecutingObject;

function pauseOnOff ()
if hostObject.Audio.IsPlaying then
hostObject.Audio.Pause();
else
hostObject.Audio.UnPause();
end
Space.Log(hostObject.Audio.IsPlaying);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(pauseOnOff);
-- Now, every time an object is clicked, the sound clip is paused/unpaused
Space.Host.ExecutingObject.Audio.UnPause()
hostObject = Space.Host.ExecutingObject;

function pauseOnOff ()
if hostObject.Audio.IsPlaying then
hostObject.Audio.Pause();
else
hostObject.Audio.UnPause();
end
Space.Log(hostObject.Audio.IsPlaying);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(pauseOnOff);
-- Now, every time an object is clicked, the sound clip is paused/unpaused
Space.Host.ExecutingObject.Audio.PlayOneShot(AResource, 1.0)
hostObject = Space.Host.ExecutingObject;

function playOnce ()
hostObject.Audio.PlayOneShot(Space.Resources[0],0.5);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(playOnce);
-- Now, every time the object is clicked, a sound clip we have in Scripting Runtime Resources is played at half the volume.

-- This happens regardless if the audio clip in the AudioClip property is playing or not.
Space.Host.ExecutingObject.Audio.PlayClipAtPoint(AResource, AVector)
--or
Space.Host.ExecutingObject.Audio.PlayClipAtPoint(AResource, AVector, 0.5)
Space.Host.ExecutingObject.Audio.Enabled = false
hostObject = Space.Host.ExecutingObject;

function audioOnOff ()
hostObject.Audio.Enabled = not hostObject.Audio.Enabled;
Space.Log(hostObject.Audio.Enabled);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(audioOnOff);
-- When the host object is clicked, the Audio Source component gets enabled, if it was disabled,
-- or disabled, if it was enabled, and its new state is printed to the console.
Space.Host.ExecutingObject.Audio.Loop = true
--the below script will make the object toggle it's Loop option OnClick
--[Add "audio" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio


OnClick = function()
audio.Loop =  not audio.Loop
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Audio.DopplerLevel = 0.5
--the below script will make a slider change the Audio Source's Doppler Level
--[Add "slider" and "audio" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.DopplerLevel = slider.Value * 5 --0 to 5
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.Audio.Volume = 0.5
hostObject = Space.Host.ExecutingObject;
Space.Log(hostObject.Audio.Volume);
-- 1 by default

function audioVolumeDecr ()
if hostObject.Audio.Volume > 0 then
hostObject.Audio.Volume = hostObject.Audio.Volume - 0.2;
end
Space.Log(hostObject.Audio.Volume);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(audioVolumeDecr);
-- Now, every time we click this object, the Volume level is decreased by 0.2, until it reaches 0.
Space.Host.ExecutingObject.Audio.Pitch = 0.5
hostObject = Space.Host.ExecutingObject;
Space.Log(hostObject.Audio.Pitch);
-- 1 by default

function audioPitchChange ()
if hostObject.Audio.Pitch < 3 then
hostObject.Audio.Pitch = hostObject.Audio.Pitch + 0.5;
end
Space.Log(hostObject.Audio.Pitch);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(audioPitchChange);
-- Now, every time we click this object, the Pitch level is increased by 0.5, until it reaches 3.
Space.Host.ExecutingObject.Audio.Time = 10
--the below script will make a slider set Audio Source's playback position (using seconds)
--[Add "slider" and "audio" references to the Scripting Runtime component]


slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.Time = slider.Value * audio.Length -- from 0 to Length of clip
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.Audio.TimeSamples = 5
--the below script will make a slider set Audio Source's playback position (using PCM Samples)
--[Add "slider" and "audio" references to the Scripting Runtime component]

slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.TimeSamples = slider.Value * audio.Samples -- from 0 to number of samples
end


slider.OnValueChanged(OVC) 
AudioLength = Space.Host.ExecutingObject.Audio.Length
--the below script will make a slider set Audio Source's playback position (using seconds)
--[Add "slider" and "audio" references to the Scripting Runtime component]


slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.Time = slider.Value * audio.Length -- from 0 to Length of clip
end

slider.OnValueChanged(OVC) 
numSamples = Space.Host.ExecutingObject.Audio.Samples
--the below script will make a slider set Audio Source's playback position (using PCM Samples)
--[Add "slider" and "audio" references to the Scripting Runtime component]

slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.TimeSamples = slider.Value * audio.Samples -- from 0 to number of samples
end


slider.OnValueChanged(OVC) 
numSamples = Space.Host.ExecutingObject.Audio.IsPlaying
 --this script will play a looping sound only if someone is using the seat
 --and will stop the sound if someone is not
--(Example: carnival game )
--[Object must contain a Seat component and AudioSource component]

thisGameObject = Space.Host.ExecutingObject


OnUpdate = function()
  if thisGameObject.Seat.InUse then
        if not thisGameObject.Audio.IsPlaying then
        thisGameObject.Audio.Play()
        end
  else
       if thisGameObject.Audio.IsPlaying then
        thisGameObject.Audio.Stop()
        end
  end
end

thisGameObject.Audio.Loop = true
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate) 
Space.Host.ExecutingObject.Audio.PanStereo = -1
--the below script will make a slider set the Stereo Pan 
--[Add "slider" and "audio" references to the Scripting Runtime component]


slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.PanStereo = (slider.Value * 2) - 1 --(from -1 left to +1 right)
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.Audio.SpatialBlend = 1
hostObject = Space.Host.ExecutingObject;

function spBlendChange ()
if hostObject.Audio.SpatialBlend < 1 then
hostObject.Audio.SpatialBlend = hostObject.Audio.SpatialBlend + 0.2;
else
hostObject.Audio.SpatialBlend = 0;
end
Space.Log(hostObject.Audio.SpatialBlend);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(spBlendChange);
-- Spatial Blend is increased by 0.2 every time the object is clicked, until it reaches 1.

-- Then with the next click, it resets back to 0.
Space.Host.ExecutingObject.Audio.Spatialize = true
--the below script will make the object toggle it's Spatialize feature OnClick
--[Add "audio" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio


OnClick = function()
audio.Spatialize =  not audio.Spatialize
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Audio.SpatializePostEffects = true
--the below script will make the object toggle it's Spatialize Post Effects feature OnClick
--[Add "audio" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio


OnClick = function()
audio.SpatializePostEffects =  not audio.SpatializePostEffects
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Audio.ReverbZoneMix = true
exa--the below script will make a slider set the Reverb Zone Mix value
--[Add "slider" and "audio" references to the Scripting Runtime component]


slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.ReverbZoneMix  = (slider.Value * 1.1) --(from 0.0 to 1.1)
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.Audio.BypassEffects = true
--the below script will make the object toggle it's Bypass Effects feature OnClick
--[Add "audio" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio


OnClick = function()
audio.BypassEffects =  not audio.BypassEffects
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Audio.BypassListenerEffects = true
--the below script will make the object toggle it's Bypass Listener Effects feature OnClick
--[Add "audio" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio


OnClick = function()
audio.BypassListenerEffects =  not audio.BypassListenerEffects
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Audio.BypassReverbZones = true
--the below script will make the object toggle it's Bypass Reverb Zones feature OnClick
--[Add "audio" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio


OnClick = function()
audio.BypassReverbZones =  not audio.BypassReverbZones
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Audio.Spread = 10.0
hostObject = Space.Host.ExecutingObject;

function increaseSpread ()
if hostObject.Audio.Spread < 360 then
hostObject.Audio.Spread = hostObject.Audio.Spread + 90;
end
Space.Log(hostObject.Audio.Spread);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(increaseSpread);
-- Every time an object is clicked, the spread increases by 90 degrees - compare the sound at different angles of spread!
Space.Host.ExecutingObject.Audio.Priority = 50
hostObject = Space.Host.ExecutingObject;

function changePriority ()
if hostObject.Audio.Priority == 0 then
hostObject.Audio.Priority = 255;
else
hostObject.Audio.Priority = 0;
end
Space.Log(hostObject.Audio.Priority);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(changePriority);
-- Now the Audio Source alternates between the highest and the lowest priorities.
-- This can be useful, for example, in a scene with an ambient sound set at Priority 128, where we have a speaker, which plays a certain looped audio nonstop.
-- When we want to hear the audio, we change it to the highest priority, so it blocks the ambient sound.
-- When we don't, we change it to the lowest, and the ambient sound dominates the scene again.
Space.Host.ExecutingObject.Audio.Mute = true
hostObject = Space.Host.ExecutingObject;

function muteOnOff ()
hostObject.Audio.Mute = not hostObject.Audio.Mute;
Space.Log(hostObject.Audio.Mute);
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(muteOnOff);
-- Now clicking the object works like the Mute button.
Space.Host.ExecutingObject.Audio.MinDistance = 2.0
--the below script will make a slider set the Minimum Distance
--[Add "slider" and "audio" references to the Scripting Runtime component]


slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.MinDistance  = (slider.Value * 20) + 10 --(from 10 to 30)
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.Audio.MaxDistance = 10.0
--the below script will make a slider set the Maximum Distance
--[Add "slider" and "audio" references to the Scripting Runtime component]


slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio


OVC = function()
audio.MaxDistance  = (slider.Value * 40) + 60 --(from 60 to 100)
end

slider.OnValueChanged(OVC) 
Space.Host.ExecutingObject.Audio.AudioClip = AResource
-- In this example, there are 3 audio clips in Scripting Runtime Resources
hostObject = Space.Host.ExecutingObject;
local nextTrack = 0;

function changeTrack ()
hostObject.Audio.AudioClip = Space.Resources[nextTrack];
hostObject.Audio.Play();
Space.Log(Space.Resources[nextTrack].Name);
if nextTrack == 2 then -- replace 2 with n-1, where n is the amount of audio clips you have added to Resources
nextTrack = 0;
else
nextTrack = nextTrack + 1;
end
end

hostObject.SubscribeToEvents();
hostObject.OnMouseDown(changeTrack);
-- Now, every time the object is clicked, the next audio clip is played.
-- What's more, the list is looped (the index resets back to 0 when it gets to the end of the list)!
theGameObject = Space.Host.ExecutingObject.Audio.GameObject
floatCost = Space.Host.ExecutingObject.NavMeshAgent.GetAreaCost(1)
Space.Host.ExecutingObject.NavMeshAgent.Move(Vector.New(2,0,0))
Space.Host.ExecutingObject.NavMeshAgent.Resume()
agentobject = Space.Scene.Find("Cube")
agent = agentobject.NavMeshAgent
if agent == nil then
    agent = Space.Scene.Find("Cube").AddNavMeshAgent()
end
counts = 0
--stop first, then resume.
function StopAndResume()
    counts = counts +1
    if counts > 10 then
      agent.Stop()
    end
    if counts > 50 then
      agent.Resume()
    end
end
agentobject.SubscribeToEvents()
agentobject.OnUpdate(StopAndResume)
agent.Destination = Space.Scene.Find("TargetTransform").WorldPosition
--set destination.
Space.Host.ExecutingObject.NavMeshAgent.SetAreaCost(1, 10.0)
Space.Host.ExecutingObject.NavMeshAgent.Stop()
Space.Host.ExecutingObject.NavMeshAgent.SetDestination(Vector.New(10,0,0))
Space.Host.ExecutingObject.NavMeshAgent.Warp(Vector.New(10,0,0))
Space.Host.ExecutingObject.NavMeshAgent.Enabled = false
--clicking this object will Enable/Disable it's Nav Mesh Agent component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.NavMeshAgent

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.NavMeshAgent.Accelleration = 60
Space.Host.ExecutingObject.NavMeshAgent.AngularSpeed = 60
Space.Host.ExecutingObject.NavMeshAgent.AreaMask = 3
Space.Host.ExecutingObject.NavMeshAgent.AutoRepath = false
Space.Host.ExecutingObject.NavMeshAgent.AutoBraking = false
Space.Host.ExecutingObject.NavMeshAgent.AutoTraverseOffMeshLink = false
Space.Host.ExecutingObject.NavMeshAgent.AvoidancePriority = 10
Space.Host.ExecutingObject.NavMeshAgent.BaseOffset = 3
vectorVelocity = Space.Host.ExecutingObject.NavMeshAgent.DesiredVelocity
Space.Host.ExecutingObject.NavMeshAgent.Destination = Vector.New(10,0,0)
hasPath = Space.Host.ExecutingObject.NavMeshAgent.HasPath
Space.Host.ExecutingObject.NavMeshAgent.Height = 5
isOn = Space.Host.ExecutingObject.NavMeshAgent.IsOnNavMesh
isOnOff = Space.Host.ExecutingObject.NavMeshAgent.IsOnOffMeshLink
isStale = Space.Host.ExecutingObject.NavMeshAgent.IsPathStale
Space.Host.ExecutingObject.NavMeshAgent.NextPosition = Vector.New(10, 0, 0)
vectorPathEndPos = Space.Host.ExecutingObject.NavMeshAgent.PathEndPosition
isPending = Space.Host.ExecutingObject.NavMeshAgent.PathPending
Space.Host.ExecutingObject.NavMeshAgent.Radius = 5
vectorDist = Space.Host.ExecutingObject.NavMeshAgent.RemainingDistance
Space.Host.ExecutingObject.NavMeshAgent.Speed = 20
vectorSteeringTarget = Space.Host.ExecutingObject.NavMeshAgent.SteeringTarget
Space.Host.ExecutingObject.NavMeshAgent.StoppingDistance = 2
Space.Host.ExecutingObject.NavMeshAgent.UpdatePosition = true
Space.Host.ExecutingObject.NavMeshAgent.UpdateRotation = true
vectorVelocity = Space.Host.ExecutingObject.NavMeshAgent.Velocity
theGameObject = Space.Host.ExecutingObject.NavMeshAgent.GameObject
IsPlaying
PanStereo
SpatialBlend
Spatialize
SpatializePostEffects
ReverbZoneMix
BypassEffects
BypassListenerEffects
BypassReverbZones
Spread
Priority
Mute
MinDistance
MaxDistance
AudioClip
DesiredVelocity
Destination
HasPath
Height
IsOnNavMesh
IsOnOffMeshLink
IsPathStale
NextPosition
PathEndPosition
PathPending
Radius
RemainingDistance
Speed
SteeringTarget
StoppingDistance
UpdatePosition
UpdateRotation
Velocity
GameObject

SScriptingResources

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

GetResource

GetResource (string name)

Returns the SResource with the specified name, or else returns nil if not found.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Return whether the ScriptingResources component is Enabled or not

Resources

SResource[] Resources get

Returns an array of all resources contained within this component.

GameObject

GameObject get

Property Description

SParticleSystem

Index

Functions Index

Function Name

SResource GetResource (string name)

bool Enabled get set

SResource[] Resources get

SGameObject GameObject get

SResource
SGameObject
resource = Space.Host.ExecutingObject.Resources.GetResource("ResourceName")
local thisObject=Space.Host.ExecutingObject
local thisObjectResource=thisObject.Resources.GetResource("Test")
if thisObjectResource == nil then
    Space.Log("That resource was not found.")
else
    Space.Log("That resource exists and can be used.")
end
Space.Host.ExecutingObject.Resources.Enabled = true
arrayOfResources = Space.Host.ExecutingObject.Resources.Resources
theGameObject = Space.Host.ExecutingObject.Resources.GameObject

void (bool withChildren) void ()

void (bool withChildren) void ()

void (bool withChildren) void ()

void (bool withChildren) void ()

bool (bool withChildren)

void (int count)

void (float time)

void (SParticleSystemTriggerEventType type, SParticle[] sp)

SParticle[] (SParticleSystemTriggerEventType type)

Properties Index

Property Name
Description

float get set

Start delay in seconds. Use this to delay when playback starts on the system.

bool get

Determines whether the Particle System is playing.

bool get

Determines whether the Particle System is emitting particles. A Particle System may stop emitting when its emission module has finished, it has been paused or if the system has been stopped.

bool get

Determines whether the Particle System is stopped.

bool get

Determines whether the Particle System is paused.

Functions

Play

void Play (bool withChildren) void Play ()

Sets the Particle Systems into play mode and enables emitting (if it has been disabled).

If the Particle System has been paused, then this resumes playing from the previous time. If the Particle System has stopped, then the system starts from time 0, and, if it is relevant, the startDelay is applied. Parameter withChildren: Plays all child Particle Systems as well.

Parameter
Type
Description

Stop

void Stop (bool withChildren) void Stop ()

Stops playing the Particle System. Parameter withChildren: Plays all child Particle Systems as well.

Parameter
Type
Description

Pause

void Pause (bool withChildren) void Pause ()

Pauses the system so no new particles are emitted and the existing particles are not updated. Parameter: withChildren: Pauses all child Particle Systems as well.

Parameter
Type
Description

Clear

void Clear (bool withChildren) void Clear ()

Remove all particles in the Particle System.

This method also removes the particles from any linked sub-emitters. Use the withChildren parameter to remove particles from child Particle Systems that are not sub-emitters of the system.

Parameter
Type
Description

IsAlive

bool IsAlive (bool withChildren)

Returns True if the Particle System contains live particles or is still creating new particles. False if the Particle System has stopped emitting particles and all particles are dead. Parameter withChildren: checks all child Particle Systems as well.

Parameter
Type
Description

Emit

void Emit (int count)

Emit 'count' particles immediately.

Parameter
Type
Description

Simulate

void Simulate (float time)

Fast-forwards the Particle System by simulating particles over 'time' seconds, then pauses it.

Parameter
Type
Description

SetTriggerParticles

void SetTriggerParticles (int type, SParticle[] sp)

Write modified particles back to the Particle System, during a call to OnParticleTrigger. type - Type of trigger to return particles for. sp -- Particle array

Parameter
Type
Description

type

int

Type of trigger to return particles for. 1 = Inside 2 = Outside 3 = Enter 4 = Exit

sp

[]

A table of SParticle

GetTriggerParticles

SParticle[] GetTriggerParticles (int type)

Get the particles that met the condition in the particle trigger module. his method is typically called from MonoBehaviour.OnParticleTrigger in response to a trigger callback.

Parameter
Type
Description

type

int

Type of trigger to return particles for. 1 = Inside 2 = Outside 3 = Enter 4 = Exit

Properties

StartDelay

float StartDelay get set

Start delay in seconds. Use this to delay when playback starts on the system.

IsPlaying

bool IsPlaying get

Determines whether the Particle System is playing.

IsEmitting

bool IsEmitting get

Determines whether the Particle System is emitting particles. A Particle System may stop emitting when its emission module has finished, it has been paused or if the system has been stopped.

IsStopped

bool IsStopped get

Determines whether the Particle System is stopped.

IsPaused

bool IsPaused get

Determines whether the Particle System is paused.

Loop

bool Loop get set

Specifies whether the Particle System is looping. If you disable looping on a playing Particle System, it stops at the end of the current loop.

PlayOnAwake

bool PlayOnAwake get set

If set to true, the Particle System will automatically start playing on startup. Note that this setting is shared between all Particle Systems in the current particle effect.

Time

float Time get set

Playback position in seconds. Use this to read current playback time or to seek to a new playback time.

Duration

float Duration get

The duration of the Particle System in seconds.

PlaybackSpeed

float PlaybackSpeed get set

The playback speed of the Particle System. 1 is normal playback speed.

ParticleCount

int ParticleCount get

The current number of particles.

EnableEmission

bool EnableEmission get set

When set to false, the Particle System will not emit particles.

EmissionRate

float EmissionRate get set

The rate of particle emission.

EmissionRateOverTime

float EmissionRateOverTime get set

The rate at which the emitter spawns new particles over time.

EmissionRateOverDistance

float EmissionRateOverDistance get set

The rate at which the emitter spawns new particles over distance. The emitter only spawns new particles when it moves.

StartSpeed

float StartSpeed get set

The initial speed of particles when the Particle System first spawns them.

StartSize

float StartSize get set

The initial size of particles when the Particle System first spawns them.

StartColor

SColor StartColor get set

The initial color of particles when the Particle System first spawns them.

StartRotation

float StartRotation get set

The initial rotation of particles when emitted. When using curves, this value acts as a scale on the curve. Note that the value should be given in radians.

StartRotation3D

SVector StartRotation3D get set

The initial 3D rotation of particles when emitted. When using curves, this value acts as a scale on the curves. Note that the values are Euler angles and should be given in radians.

StartLifetime

float StartLifetime get set

The total lifetime in seconds that particles will have when emitted. When using curves, this value acts as a scale on the curve. This value is set in the particle when it is created by the Particle System.

GravityModifier

float GravityModifier get set

A scale that this Particle System applies to gravity.

MaxParticles

int MaxParticles get set

The maximum number of particles to emit.

RandomSeed

uint RandomSeed get set

Override the random seed used for the Particle System emission.

UseAutoRandomSeed

bool UseAutoRandomSeed get set

Controls whether the Particle System uses an automatically-generated random number to seed the random number generator. If set to true, the Particle System will generate a new random seed each time it is played. If set to false, ParticleSystem.randomSeed will be used instead, allowing for a constant seed (useful if you want your particles to play in exactly the same way each time) or user-defined random value (for example, you may want to cycle through an array of seeds).

GameObject

SGameObject GameObject get

Property Description

STrailRenderer

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

Clear

void Clear ()

Function Description

Parameter
Type
Description

GetPosition

GetPosition (int index)

Get the position of a vertex in the trail.

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Whether this TrailRenderer component is Enabled.

ReceiveShadows

bool ReceiveShadows get set

Does this object receive shadows?

IsVisible

bool IsVisible get

Is this renderer visible in any camera?

CastShadows

bool CastShadows get set

Does the trail cast a shadow when a shadow-casting Light shines on it?

MotionVectors

bool MotionVectors get set

Set whether to use motion vectors to track this Renderer’s per-pixel, screen-space motion from one frame to the next. You can use this information to apply post-processing effects such as motion blur.

UseLightProbes

bool UseLightProbes get set

Enable Light Probes on the trail.

Time

float Time get set

How long does the trail take to fade out. (seconds)

StartWidth

float StartWidth get set

The width of the trail at the spawning point. A width of 1 corresponds to 1 unit in the game world.

EndWidth

float EndWidth get set

The width of the trail at the end of the trail. A width of 1 corresponds to 1 unit in the game world.

WidthMultiplier

float WidthMultiplier get set

Set an overall multiplier that is applied to the TrailRenderer.widthCurve to get the final width of the trail.

StartColor

StartColor get set

Set the color at the start of the trail.

EndColor

EndColor get set

Set the color at the end of the trail.

Autodestruct

bool Autodestruct get set

Does the GameObject of this Trail Renderer auto destruct?

NumCornerVertices

int NumCornerVertices get set

Set this to a value greater than 0, to get rounded corners between each segment of the trail.

NumCapVertices

int NumCapVertices get set

Set this to a value greater than 0, to get rounded corners on each end of the trail.

MinVertexDistance

float MinVertexDistance get set

Set the minimum distance the trail can travel before a new vertex is added to it. Smaller values with give smoother trails, consisting of more vertices, but costing more performance.

TextureMode

int TextureMode get set

Choose whether the U coordinate of the trail texture is tiled or stretched. 0 Stretch, 1 Tile, 2 Distribute Per Segment, 3 Repeat Per Segment

Alignment

int Alignment get set

Property Description

PositionCount

int PositionCount get

Get the number of line segments in the trail.

GameObject

SGameObject GameObject get

Property Description

Space.Host.ExecutingObject.ParticleSystem.Play()
--or
Space.Host.ExecutingObject.ParticleSystem.Play(true)
Space.Host.ExecutingObject.ParticleSystem.Stop()
--or
Space.Host.ExecutingObject.ParticleSystem.Stop(true)
Space.Host.ExecutingObject.ParticleSystem.Pause()
--or
Space.Host.ExecutingObject.ParticleSystem.Pause(true)
Space.Host.ExecutingObject.ParticleSystem.Clear()
--or
Space.Host.ExecutingObject.ParticleSystem.Clear(true)
isAlive = Space.Host.ExecutingObject.ParticleSystem.IsAlive()
--or
isAlive = Space.Host.ExecutingObject.ParticleSystem.IsAlive(true)
Space.Host.ExecutingObject.ParticleSystem.Emit(100)
Space.Host.ExecutingObject.ParticleSystem.Simulate(5.0)
Space.Host.ExecutingObject.ParticleSystem.SetTriggerParticles(0,ParticlesArray)
ParticlesArray = Space.Host.ExecutingObject.ParticleSystem.GetTriggerParticles(0)
Space.Host.ExecutingObject.ParticleSystem.StartDelay = 5
isPlaying = Space.Host.ExecutingObject.ParticleSystem.IsPlaying
isEmitting = Space.Host.ExecutingObject.ParticleSystem.IsEmitting
isStopped = Space.Host.ExecutingObject.ParticleSystem.IsStopped
isPaused = Space.Host.ExecutingObject.ParticleSystem.IsPaused
Space.Host.ExecutingObject.ParticleSystem.Loop = true
Space.Host.ExecutingObject.ParticleSystem.PlayOnAwake
Space.Host.ExecutingObject.ParticleSystem.Time = 5.0
duration = Space.Host.ExecutingObject.ParticleSystem.Duration
Space.Host.ExecutingObject.ParticleSystem.PlaybackSpeed =  1.5
count = Space.Host.ExecutingObject.ParticleSystem.ParticleCount
Space.Host.ExecutingObject.ParticleSystem.EnableEmission = true
 Space.Host.ExecutingObject.ParticleSystem.EmissionRate = 10 
 Space.Host.ExecutingObject.ParticleSystem.EmissionRateOverTime = 10 
 Space.Host.ExecutingObject.ParticleSystem.EmissionRateOverDistance = 10 
 Space.Host.ExecutingObject.ParticleSystem.StartSpeed = 10 
 Space.Host.ExecutingObject.ParticleSystem.StartSize = 1.2 
 Space.Host.ExecutingObject.ParticleSystem.StartColor = Color.Red
 Space.Host.ExecutingObject.ParticleSystem.StartRotation = 20.5
 Space.Host.ExecutingObject.ParticleSystem.StartRotation3D = Vector.New(0,20,20) 
 Space.Host.ExecutingObject.ParticleSystem.StartLifetime = 20 
 Space.Host.ExecutingObject.ParticleSystem.GravityModifier = 1.2 
 Space.Host.ExecutingObject.ParticleSystem.MaxParticles = 500
 Space.Host.ExecutingObject.ParticleSystem.RandomSeed = 23423423 
spawningparticles = Space.Scene.Find("Particles")
--get particle object and get the particle system component on it.
particles=spawningparticles.ParticleSystem
--set random seed.
particles.UseAutoRandomSeed = false
particles.RandomSeed = 123456
Space.Host.ExecutingObject.ParticleSystem.UseAutoRandomSeed = true 
theGameObject = Space.Host.ExecutingObject.ParticleSystem.GameObject

bool Loop get set

Specifies whether the Particle System is looping. If you disable looping on a playing Particle System, it stops at the end of the current loop.

bool PlayOnAwake get set

If set to true, the Particle System will automatically start playing on startup. Note that this setting is shared between all Particle Systems in the current particle effect.

float Time get set

Playback position in seconds. Use this to read current playback time or to seek to a new playback time.

float Duration get

The duration of the Particle System in seconds.

float PlaybackSpeed get set

The playback speed of the Particle System. 1 is normal playback speed.

int ParticleCount get

The current number of particles.

bool EnableEmission get set

When set to false, the Particle System will not emit particles.

float EmissionRate get set

The rate of particle emission.

float EmissionRateOverTime get set

The rate at which the emitter spawns new particles over time.

float EmissionRateOverDistance get set

The rate at which the emitter spawns new particles over distance. The emitter only spawns new particles when it moves.

float StartSpeed get set

The initial speed of particles when the Particle System first spawns them.

float StartSize get set

The initial size of particles when the Particle System first spawns them.

SColor StartColor get set

The initial color of particles when the Particle System first spawns them.

float StartRotation get set

The initial rotation of particles when emitted. When using curves, this value acts as a scale on the curve. Note that the value should be given in radians.

SVector StartRotation3D get set

The initial 3D rotation of particles when emitted. When using curves, this value acts as a scale on the curves. Note that the values are Euler angles and should be given in radians.

float StartLifetime get set

The total lifetime in seconds that particles will have when emitted. When using curves, this value acts as a scale on the curve. This value is set in the particle when it is created by the Particle System.

float GravityModifier get set

A scale that this Particle System applies to gravity.

int MaxParticles get set

The maximum number of particles to emit.

uint RandomSeed get set

Override the random seed used for the Particle System emission.

bool UseAutoRandomSeed get set

Controls whether the Particle System uses an automatically-generated random number to seed the random number generator. If set to true, the Particle System will generate a new random seed each time it is played. If set to false, ParticleSystem.randomSeed will be used instead, allowing for a constant seed (useful if you want your particles to play in exactly the same way each time) or user-defined random value (for example, you may want to cycle through an array of seeds).

SGameObject GameObject get

Play
Play
Stop
Stop
Pause
Pause
Clear
Clear
IsAlive
Emit
Simulate
SetTriggerParticles
GetTriggerParticles
StartDelay
IsPlaying
IsEmitting
IsStopped
IsPaused
SParticle

SColor get set

SColor get set

bool get set

int get set

int get set

float get set

int get set

int get set

int get

SGameObject get

void Clear ()

SVector GetPosition (int index)

bool Enabled get set

bool ReceiveShadows get set

bool IsVisible get

bool CastShadows get set

bool MotionVectors get set

bool UseLightProbes get set

float Time get set

float StartWidth get set

float EndWidth get set

SVector
SColor
SColor

float get set

SRigidbody

Index

Functions Index

Function Name
Space.Host.ExecutingObject.TrailRenderer.Clear()
vectorPos = Space.Host.ExecutingObject.TrailRenderer.GetPosition(0)
Space.Host.ExecutingObject.TrailRenderer.Enabled = true
--Clicking the object Enables/Disables the Trail Renderer component on this object  
--[Add "trailrenderer" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OnClick = function()
trailrenderer.Enabled =  not trailrenderer.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.TrailRenderer.ReceiveShadows = true
--Make a UIToggle disable/enable the Receive Shadows feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

toggle = Space.Host.GetReference("toggle").UIToggle 
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer

toggle.IsOn = trailrenderer.ReceiveShadows  --make toggle start at correct state

OVC = function()
  if toggle.IsOn then
    trailrenderer.ReceiveShadows  = true
  else
    trailrenderer.ReceiveShadows  = false
  end
end

toggle.OnValueChanged(OVC)
Space.Log(Space.Host.ExecutingObject.TrailRenderer.IsVisible)
Space.Host.ExecutingObject.TrailRenderer.CastShadows = true
--Make a UIToggle disable/enable the Cast Shadows feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

toggle = Space.Host.GetReference("toggle").UIToggle 
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer

toggle.IsOn = trailrenderer.CastShadows  --make toggle start at correct state

OVC = function()
  if toggle.IsOn then
    trailrenderer.CastShadows  = true
  else
    trailrenderer.CastShadows  = false
  end
end

toggle.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.MotionVectors = true
--Make a UIToggle disable/enable the Motion Vectors feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

toggle = Space.Host.GetReference("toggle").UIToggle 
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer

toggle.IsOn = trailrenderer.MotionVectors  --make toggle start at correct state

OVC = function()
  if toggle.IsOn then
    trailrenderer.MotionVectors  = true
  else
    trailrenderer.MotionVectors  = false
  end
end

toggle.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.UseLightProbes = true
--Make a UIToggle disable/enable the Light Probes feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

toggle = Space.Host.GetReference("toggle").UIToggle 
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer

toggle.IsOn = trailrenderer.UseLightProbes  --make toggle start at correct state

OVC = function()
  if toggle.IsOn then
    trailrenderer.UseLightProbes  = true
  else
    trailrenderer.UseLightProbes  = false
  end
end

toggle.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.Time = 10
--Make a slider change the Trail Renderer's Time
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OVC = function()
trailrenderer.Time = slider.Value * 10 --0 to 10
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.StartWidth = 1.1
--Make a slider change the Trail Renderer's Start Width
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OVC = function()
trailrenderer.StartWidth = slider.Value * 10 --0 to 10
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.EndWidth = 0.1
--Make a slider change the Trail Renderer's End Width
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OVC = function()
trailrenderer.EndWidth = slider.Value * 10 --0 to 10
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.WidthMultiplier = 2
--Make a slider change the Trail Renderer's Width Multiplier
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OVC = function()
trailrenderer.WidthMultiplier = slider.Value * 10 --0 to 10
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.StartColor = Color.Black
--makes UIButton open a color picker to change TrailRenderer's Start Color
--[Add "button" and "trailrenderer" references to the Scripting Runtime component]

button = Space.Host.GetReference("button").UIButton 
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
originalColor = trailrenderer.StartColor

OnChange = function(SColor) 
 trailrenderer.StartColor = SColor
end

OnSelect = function(SColor)
 trailrenderer.StartColor = SColor
end

OnCancel = function()
  trailrenderer.StartColor = originalColor 
end

OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end


button.OnClick(OnClick)
Space.Host.ExecutingObject.TrailRenderer.EndColor = Color.Red
--makes UIButton open a color picker to change TrailRenderer's End Color
--[Add "button" and "trailrenderer" references to the Scripting Runtime component]

button = Space.Host.GetReference("button").UIButton 
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
originalColor = trailrenderer.EndColor

OnChange = function(SColor) 
 trailrenderer.EndColor = SColor
end

OnSelect = function(SColor)
 trailrenderer.EndColor = SColor
end

OnCancel = function()
  trailrenderer.EndColor = originalColor 
end

OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end


button.OnClick(OnClick)
Space.Host.ExecutingObject.TrailRenderer.Autodestruct = true
--Make a UIToggle disable/enable the Autodestruct feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

toggle = Space.Host.GetReference("toggle").UIToggle 
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer

toggle.IsOn = trailrenderer.Autodestruct  --make toggle start at correct state

OVC = function()
  if toggle.IsOn then
    trailrenderer.Autodestruct  = true
  else
    trailrenderer.Autodestruct  = false
  end
end

toggle.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.NumCornerVertices = 2
--Make a slider change the Trail Renderer's Number of Corner Vertices
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OVC = function()
trailrenderer.NumCornerVertices = slider.Value * 90 --0 to 90
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.NumCapVertices = 3
--Make a slider change the Trail Renderer's Number of End Cap Vertices
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OVC = function()
trailrenderer.NumCapVertices = slider.Value * 90 --0 to 90
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.MinVertexDistance = 1
--Make a slider change the Trail Renderer's Number of Mininum Vertex Distance
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject

slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OVC = function()
trailrenderer.MinVertexDistance = slider.Value * 10 --0 to 10
end

slider.OnValueChanged(OVC)
Space.Host.ExecutingObject.TrailRenderer.TextureMode = 2
--Clicking the object toggles between TrailRenderer's 4 different Texture Modes
--[Add "trailrenderer" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OnClick = function()
  if trailrenderer.TextureMode == 3 then
    trailrenderer.TextureMode = 0
  else
    trailrenderer.TextureMode = trailrenderer.TextureMode + 1
  end
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.TrailRenderer.Alignment = 1
--Clicking the object toggles between TrailRenderer's View or Transform Z alignment
--[Add "trailrenderer" reference to the Scripting Runtime component]

thisGameObject = Space.Host.ExecutingObject
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer


OnClick = function()
  if trailrenderer.Alignment == 0 then
    trailrenderer.Alignment = 1
  else
    trailrenderer.Alignment = 0
  end
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
numLineSegments = Space.Host.ExecutingObject.TrailRenderer.PositionCount
theGameObject = Space.Host.ExecutingObject.TrailRenderer.GameObject
WidthMultiplier
StartColor
EndColor
Autodestruct
NumCornerVertices
NumCapVertices
MinVertexDistance
TextureMode
Alignment
PositionCount
GameObject

void (float explosionForce, SVector explosionPosition, float explosionRadius, float upwardsModifier)

void (SVector force)

void (SVector force, SVector position)

void (SVector torque)

void (SVector torque)

SVector (SVector input)

SVector (SVector worldPoint)

SVector (SVector point)

void (SVector point)

void (SQuaternion rotation)

void ()

Properties Index

Property Name

float get set

SVector get set

SVector get set

float get set

bool get set

bool get set

float get set

float get set

float get set

Functions

AddExplosionForce

void AddExplosionForce (float explosionForce, SVector explosionPosition, float explosionRadius, float upwardsModifier)

Applies a force to a rigidbody that simulates explosion effects. Other rigidbodies will be affected by the explosion within its radius - the closer they are to the explosionPosition, the stronger the force will be exerted on them.

Parameter
Type
Description

AddForce

void AddForce (SVector force)

Adds a force to the Rigidbody that is continuously exerted on it in the given direction.

Parameter
Type
Description

AddForceAtPosition

void AddForceAtPosition (SVector force, SVector position)

Adds a force to the Rigidbody at a given position (should be within the range of the rigidbody for a realistic result). Thus, both a torque and force are applied to the object.

Parameter
Type
Description

AddRelativeTorque

void AddRelativeTorque (SVector torque)

Adds a torque to the rigidbody relative to the local coordinate system.

Parameter
Type
Description

AddTorque

void AddTorque (SVector torque)

Adds a torque to the rigidbody relative to the global coordinate system.

Parameter
Type
Description

ClosestPointOnBounds

SVector ClosestPointOnBounds (SVector input)

Returns the closest point on the bounding box of the attached colliders.

Parameter
Type
Description

GetPointVelocity

SVector GetPointVelocity (SVector worldPoint)

Function Description

Parameter
Type
Description

GetRelativePointVelocity

SVector GetRelativePointVelocity (SVector point)

Function Description

Parameter
Type
Description

MovePosition

void MovePosition (SVector point)

Moves the rigidbody to position.

Parameter
Type
Description

MoveRotation

void MoveRotation (SQuaternion rotation)

Rotates the rigidbody to rotation.

Parameter
Type
Description

ResetCenterOfMass

void ResetCenterOfMass ()

Reset the center of mass of the rigidbody.

ResetIntertiaTensor

void ResetIntertiaTensor ()

Reset the inertia tensor value and rotation.

Sleep

void Sleep ()

Forces a rigidbody to sleep.

WakeUp

void WakeUp ()

Forces a rigidbody to wake up.

SweepTestAll

SPhysicsHit[] SweepTestAll (SVector direction, float distance)

Like Rigidbody.SweepTest, but returns all hits.

Parameter
Type
Description

Properties

AngularDrag

float AngularDrag get set

The angular drag of the object.

AngularVelocity

SVector AngularVelocity get set

The angular velocity vector of the rigidbody (in radians per second).

CenterOfMass

SVector CenterOfMass get set

The center of mass relative to the local origin.

Drag

float Drag get set

The drag of the object.

FreezeRotation

bool FreezeRotation get set

Controls whether physics will have any impact on the rotation of the object.

Kinematic

bool Kinematic get set

Controls whether physics will have any impact on the object.

Mass

float Mass get set

The mass of the rigidbody.

MaxAngularVelocity

float MaxAngularVelocity get set

The maximum angular velocity of the rigidbody (7 by default). Can be useful to prevent an object from spinning uncontrollably fast.

MaxDepenetrationVelocity

float MaxDepenetrationVelocity get set

The maximum depenetration velocity of the rigidbody (1.00000003318135E+32 by default). Can be useful to make colliding objects bounce away in a smoother fashion.

UseGravity

bool UseGravity get set

Controls whether gravity affects the rigidbody.

Velocity

SVector Velocity get set

The velocity vector of the rigidbody. (in units per second).

WorldCenterOfMass

SVector WorldCenterOfMass get

The center of mass of the rigidbody relative to the global origin (Read Only).

Sleeping

bool Sleeping get

Is the rigidbody sleeping?

Density

float Density set

The density of the object (1 by default). Changing this value will affect the mass of the object (the volume will remain unchanged).

InertiaTensor

SVector InertiaTensor get set

The diagonal inertia tensor of mass relative to the center of mass. It is defined in x,y,z axis. It is calculate by physics automatically,and if you set value to it, it would override the value.

InertiaTensorRotation

SQuaternion InertiaTensorRotation get set

The rotation of the inertia tensor.

GameObject

SGameObject GameObject get

Property Description

SLineRenderer

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

SetPosition

void SetPosition (int index, position)

Set the position of a vertex in the line.

Parameter
Type
Description

GetPosition

GetPosition (int index)

Get the position of a vertex in the line

Parameter
Type
Description

SetPositions

void SetPositions ([] positions)

Set the positions of all vertices in the line.

Parameter
Type
Description

GetPositions

[] GetPositions ()

Get the positions of all vertices in the line.

SetWidth

void SetWidth (float start, float end)

Set width at start and end

Parameter
Type
Description

SetColors

void SetColors ( start, end)

Set color at start and end (Line shader necessary)

Parameter
Type
Description

Properties

Enabled

bool Enabled get set

Makes the renderer visible if enabled.

ReceiveShadows

bool ReceiveShadows get set

Enable this option to make the line display any shadows that are cast upon it.

IsVisible

bool IsVisible get

To check if this renderer is visible.

CastShadows

bool CastShadows get set

Specify if and how the line casts shadows when a suitable Light shine on it.

MotionVectors

bool MotionVectors get set

Specifies whether this renderer has a per-object motion vector pass. If set to true, this object will have a per-object motion vector pass rendered

UseLightProbes

bool UseLightProbes get set

The light probe interpolation type.

StartWidth

float StartWidth get set

Set the width at the start of the line.

EndWidth

float EndWidth get set

Set the width at the end of the line.

WidthMultiplier

float WidthMultiplier get set

Set an overall multiplier that is applied to the LineRenderer.widthCurve to get the final width of the line.

StartColor

StartColor get set

Set the color at the start of the line.

EndColor

EndColor get set

Set the color at the end of the line.

PositionCount

int PositionCount get set

Set/get the number of vertices.

UseWorldSpace

bool UseWorldSpace get set

If enabled, the points are considered as world space coordinates. If disabled, they are local to the transform of the GameObject to which this component is attached.

Loop

bool Loop get set

Enable this to connect the first and last positions of the line, and form a closed loop.

NumCornerVertices

int NumCornerVertices get set

Set this to a value greater than 0, to get rounded corners between each segment of the line.

NumCapVertices

int NumCapVertices get set

Set this to a value greater than 0, to get rounded corners on each end of the line.

TextureMode

int TextureMode get set

Control how the Texture is applied to the line. (0-3)

Alignment

int Alignment get set

Set the direction that the line faces. (0 or 1)

GameObject

GameObject get

Property Description

Space.Host.ExecutingObject.Rigidbody.AddExplosionForce (300, Vector.New(0,0,0), 10, 20)
local obj = Space.Host.ExecutingObject;

obj.Rigidbody.AddExplosionForce (300, obj.WorldPosition, 10, 20)
-- The explosion will occur at the location of the ExecutingObject.
-- Place other rigidbodies around it to observe the effect!
Space.Host.ExecutingObject.Rigidbody.AddForce(Vector.New(0,1,0))
local obj = Space.Host.ExecutingObject;

obj.Rigidbody.AddForce (Vector.New(0,100,0));
-- Now the rigidbody is under a continuous force directed upwards (Y direction)
Space.Host.ExecutingObject.Rigidbody.AddForceAtPosition(Vector.New(1,1,1), Vector.New(0,1,0))
local obj = Space.Host.ExecutingObject;
local applyForceHere = Vector.New(obj.WorldPosition.x-0.5,obj.WorldPosition.y-0.5,obj.WorldPosition.z-0.5)
-- This vector is equivalent to one of the lower corners of a 1x1x1 cube.

obj.Rigidbody.AddForceAtPosition (Vector.New(0,40,0), applyForceHere);
-- The object is experiencing an effect similar to being tipped upwards at the aforementioned corner.
Space.Host.ExecutingObject.Rigidbody.AddRelativeTorque(Vector.New(0,1,0))
local obj = Space.Host.ExecutingObject;

obj.Rigidbody.AddRelativeTorque (Vector.New(0,100,0));
-- Now the object spins about its own Y axis
Space.Host.ExecutingObject.Rigidbody.AddTorque(Vector.New(0,1,0))
local obj = Space.Host.ExecutingObject;

obj.Rigidbody.AddTorque (Vector.New(0,100,0));
-- Now the object spins about the global Y axis
Space.Host.ExecutingObject.Rigidbody.ClosestPointOnBounds(Vector.New(1,1,1))
local obj = Space.Host.ExecutingObject;

Space.Log(obj.Rigidbody.ClosestPointOnBounds (Vector.Zero));
-- prints [x,y,z] to the console, where x,y,z are coordinates of the rigidbody's point that is the closest to the global origin
Space.Host.ExecutingObject.Rigidbody.GetPointVelocity(Vector.New(0,1,0))
Space.Host.ExecutingObject.Rigidbody.GetRelativePointVelocity(Vector.New(1,1,1))
Space.Host.ExecutingObject.Rigidbody.MovePosition(Vector.New(1,1,1))
local obj = Space.Host.ExecutingObject;
local moveHere = Vector.New(obj.WorldPosition.x+10,obj.WorldPosition.y,obj.WorldPosition.z);

obj.Rigidbody.MovePosition (moveHere);
-- The object has been moved by 10 units in the positive X direction
Space.Host.ExecutingObject.Rigidbody.MoveRotation(Quaternion.New(0,1,0,0))
local obj = Space.Host.ExecutingObject;
local setRotationTo = Quaternion.Euler(60,0,0)

obj.Rigidbody.MoveRotation (setRotationTo);
-- The object's rotation has been set to 60 degrees in the positive X direction and 0 in Y and Z
Space.Host.ExecutingObject.Rigidbody.ResetCenterOfMass()
local obj = Space.Host.ExecutingObject;

obj.Rigidbody.CenterOfMass = Vector.New(1,1,1);
Space.Log(obj.Rigidbody.CenterOfMass);
-- prints "[1,1,1]" to the console

obj.Rigidbody.ResetCenterOfMass();
Space.Log(obj.Rigidbody.CenterOfMass);
-- prints "[0,0,0]" to the console
Space.Host.ExecutingObject.Rigidbody.ResetIntertiaTensor()
solid = Space.Scene.Find("Solid")
--get rigidbody of inertia frame.
rigid = solid.Rigidbody
if rigid == nil then
    rigid = solid.AddRigidbody()
end
rigid.ResetIntertiaTensor()
--to reset inertia tensor if intertia tensor is set
Space.Host.ExecutingObject.Rigidbody.Sleep()
Space.Host.ExecutingObject.Rigidbody.WakeUp()
Space.Host.ExecutingObject.Rigidbody.SweepTestAll(Vector.New(1,0,0) , 20)
solid = Space.Scene.Find("Solid")
--get rigidbody of inertia frame.
rigid = solid.Rigidbody
if rigid == nil then
    rigid = solid.AddRigidbody()
end
hits = rigid.SweepTestAll(solid.Forward , 20)
--sweep forward 20 meters, and return all hits.
if hits~=nil and #hits-1 > 0 then
    for i = 1,#hits-1 do
        Space.Log(hits[i].Object.Name)
    end
end
--output all hit gameobject.
Space.Host.ExecutingObject.Rigidbody.AngularDrag = 0.20
Space.Host.ExecutingObject.Rigidbody.AngularVelocity = Vector.New(0,1,0)
local obj = Space.Host.ExecutingObject;

-- Set a new angular velocity vector
obj.Rigidbody.AngularVelocity = Vector.New(0,Space.Math.Pi,0);
-- Now the object is rotating about the Y axis at a speed of 180 degrees per second
-- (or 30 revolutions per minute)

-- Get the current angular velocity vector
Space.Log(obj.Rigidbody.AngularVelocity);
-- prints "[0, 3.141593, 0]" to the console
Space.Host.ExecutingObject.Rigidbody.CenterOfMass = Vector.New(1,0,0)
Space.Host.ExecutingObject.Rigidbody.Drag = 5
Space.Host.ExecutingObject.Rigidbody.FreezeRotation = true
Space.Host.ExecutingObject.Rigidbody.Kinematic = true
Space.Host.ExecutingObject.Rigidbody.Mass = 0.1
Space.Host.ExecutingObject.Rigidbody.MaxAngularVelocity = 1
Space.Host.ExecutingObject.Rigidbody.MaxDepenetrationVelocity = 1
Space.Host.ExecutingObject.Rigidbody.UseGravity = true
local obj = Space.Host.ExecutingObject;

-- Set UseGravity to False (it is set to True by default)
obj.Rigidbody.UseGravity = false;
-- Now gravity does not affect the rigidbody.

-- Get the UseGravity value (find out if UseGravity is in action)
Space.Log(obj.Rigidbody.UseGravity);
-- prints "False" to the console
Space.Host.ExecutingObject.Rigidbody.Velocity = Vector.New(0,1,0)
local obj = Space.Host.ExecutingObject;

-- Set a new velocity vector
obj.Rigidbody.Velocity = Vector.New(0, 0, 1);
-- Now the object is moving in the positive Z direction at a speed of 1 unit per second

-- Get the current velocity vector
Space.Log(obj.Rigidbody.Velocity);
-- prints "[0, 0, 1]" to the console
WorldCenter = Space.Host.ExecutingObject.Rigidbody.WorldCenterOfMass
local obj = Space.Host.ExecutingObject;

-- Get the current center of mass
Space.Log(obj.Rigidbody.WorldCenterOfMass);
-- prints "[x, y, z]" to the console, where x,y,z are global coordinates of the center of mass. If CenterOfMass == [0,0,0], then x,y,z are equal to the global coordinates of the object.
isSleeping = Space.Host.ExecutingObject.Rigidbody.Sleeping
local obj = Space.Host.ExecutingObject;

obj.Rigidbody.Sleep();
Space.Log(obj.Rigidbody.Sleeping);
-- prints "True" to the console

obj.Rigidbody.WakeUp();
Space.Log(obj.Rigidbody.Sleeping);
-- prints "False" to the console
density = Space.Host.ExecutingObject.Rigidbody.Density
local obj = Space.Host.ExecutingObject;

Space.Log(obj.Rigidbody.Mass);
-- prints "1" to the console
obj.LocalScale = Vector.New(2,2,2);
obj.Rigidbody.Density = 0.5;
Space.Log(obj.Rigidbody.Mass);
-- prints "4" to the console - the density is 2 times lower, and the object is 8 times bigger, therefore it's 4 times heavier.
Space.Host.ExecutingObject.Rigidbody.IntertiaTensor = Vector.New(0,0,0)
solid = Space.Scene.Find("Solid")
--get rigidbody of inertia frame.
rigid = solid.Rigidbody
if rigid == nil then
    rigid = solid.AddRigidbody()
end
rigid.InertiaTensor = Vector.New(10,100,1)
rigid.AddTorque(Vector.New(100,100,100))
--set inertia tensor to 10,100,1, and add torque 100 to all axis,and rotate velocity x:y:z would be 10:1:100.
Space.Host.ExecutingObject.Rigidbody.InertiaTensorRotation = Quaternion.New(0,0,0,0)
solid = Space.Scene.Find("Solid")
--get rigidbody of inertia frame.
rigid = solid.Rigidbody
if rigid == nil then
    rigid = solid.AddRigidbody()
end
rigid.InertiaTensor = Vector.New(10,100,1)
rigid.InertiaTensorRotation = Quaternion.Euler(0,90,0)
rigid.AddTorque(Vector.New(100,100,100))
--set inertia tensor manually and rotate this inertia tensor by 90 degrees in y axis.
theGameObject = Space.Host.ExecutingObject.Rigidbody.GameObject

void ResetIntertiaTensor ()

void Sleep ()

void WakeUp ()

SPhysicsHit[] SweepTestAll (SVector direction, float distance)

bool UseGravity get set

SVector Velocity get set

SVector WorldCenterOfMass get

bool Sleeping get

float Density set

SVector InertiaTensor get set

SQuaternion InertiaTensorRotation get set

SGameObject GameObject get

AddExplosionForce
AddForce
AddForceAtPosition
AddRelativeTorque
AddTorque
ClosestPointOnBounds
GetPointVelocity
GetRelativePointVelocity
MovePosition
MoveRotation
ResetCenterOfMass
AngularDrag
AngularVelocity
CenterOfMass
Drag
FreezeRotation
Kinematic
Mass
MaxAngularVelocity
MaxDepenetrationVelocity

SColor get set

int get set

bool get set

bool get set

int get set

int get set

int get set

int get set

SGameObject get

void SetPosition (int index, SVector position)

SVector GetPosition (int index)

void SetPositions (SVector[] positions)

SVector[] GetPositions ()

void SetWidth (float start, float end)

void SetColors (SColor start, SColor end)

bool Enabled get set

bool ReceiveShadows get set

bool IsVisible get

bool CastShadows get set

bool MotionVectors get set

bool UseLightProbes get set

float StartWidth get set

float EndWidth get set

float WidthMultiplier get set

SVector
SVector
SVector
SVector
SColor
SColor
SColor
SColor
SGameObject

SColor get set

Space.Host.ExecutingObject.LineRenderer.SetPosition(1,Vector.New(0,0,0))
--this object will continuously render a line between two different game objects

refObject1 = Space.Host.GetReference("object1") --Add in References section of Scripting Runtime Component
refObject2 = Space.Host.GetReference("object2") --Add in References section of Scripting Runtime Component

thisObject = Space.Host.ExecutingObject

function OnUpdateFunction()
  thisObject.LineRenderer.PositionCount = 2 --this is necessary 

  thisObject.LineRenderer.SetPosition(1,refObject1.WorldPosition)
  thisObject.LineRenderer.SetPosition(2,refObject2.WorldPosition)

end

thisObject.OnUpdate(OnUpdateFunction)
vectorPosition = Space.Host.ExecutingObject.LineRenderer.GetPosition(1)
 Space.Host.ExecutingObject.LineRenderer.SetPositions({Vector.New(0,0,0) , Vector.New(1,1,1)})
--this object will continuously render a line between two different game objects

refObject1 = Space.Host.GetReference("object1") --Add in References section of Scripting Runtime Component
refObject2 = Space.Host.GetReference("object2") --Add in References section of Scripting Runtime Component

thisObject = Space.Host.ExecutingObject

function OnUpdateFunction()
  thisObject.LineRenderer.PositionCount = 2 --this is necessary
  thisObject.LineRenderer.SetPositions({refObject1.WorldPosition,refObject2.WorldPosition})

end

thisObject.OnUpdate(OnUpdateFunction)
tableVectorPositions = Space.Host.ExecutingObject.LineRenderer.GetPositions()
Space.Host.ExecutingObject.LineRenderer.SetWidth(5,7)
--the below script will make a slider set both the Line Renderer's Start Width and End Width
thisGameObject = Space.Host.ExecutingObject

refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component



OVC = function()
  local width = (refSlider.UISlider.Value * 5)  -- from 0 to 5
  refLineRenderer.LineRenderer.SetWidth(width,width)
end

refSlider.UISlider.OnValueChanged(OVC)
Space.Host.ExecutingObject.LineRenderer.SetColors(Color.Red, Color.Blue)
--clicking the object will open a color picker that changes both Line Renderer's Start Color and End Color

thisGameObject = Space.Host.ExecutingObject
originalStartColor = thisGameObject.LineRenderer.StartColor
originalEndColor = thisGameObject.LineRenderer.EndColor

OnChange = function(SColor) 
  thisGameObject.LineRenderer.SetColors(SColor,SColor) 
end

OnSelect = function(SColor)
    thisGameObject.LineRenderer.SetColors(SColor,SColor) 
end

OnCancel = function()
   thisGameObject.LineRenderer.SetColors(originalStartColor,originalEndColor) 
end

OnClick = function()
  Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalStartColor)
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.LineRenderer.Enabled = false
--clicking this object toggles it's LineRenderer component On/Off

thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  thisObject.LineRenderer.Enabled =  not thisObject.LineRenderer.Enabled
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.LineRenderer.ReceiveShadows = false
--clicking this object toggles it's Recieve Shadows options

thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  thisObject.LineRenderer.ReceiveShadows =  not thisObject.LineRenderer.ReceiveShadows
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
isVisible = Space.Host.ExecutingObject.LineRenderer.IsVisible
Space.Host.ExecutingObject.LineRenderer.CastShadows = true
Space.Host.ExecutingObject.LineRenderer.MotionVectors = true
--clicking this object toggles it's Line Renderer's Motion Vectors (Per Object Motion or Force no motion)
thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  thisObject.LineRenderer.MotionVectors =  not thisObject.LineRenderer.MotionVectors
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.LineRenderer.UseLightProbes = true
--clicking this object toggles it's Light Probe between Off and Blend Mode

thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  thisObject.LineRenderer.UseLightProbes =  not thisObject.LineRenderer.UseLightProbes
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.LineRenderer.StartWidth = 1
--the below script will make a slider change the Line Renderers start width


thisGameObject = Space.Host.ExecutingObject

refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component

refSlider.UISlider.Value = refLineRenderer.LineRenderer.StartWidth / 2 --initial position of slider

OVC = function()
  refLineRenderer.LineRenderer.StartWidth = (refSlider.UISlider.Value * 2)  -- from 0 to 2
end

refSlider.UISlider.OnValueChanged(OVC)
Space.Host.ExecutingObject.LineRenderer.EndWidth = 2
--the below script will make a slider change the Line Renderer's End Width
thisGameObject = Space.Host.ExecutingObject

refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component

refSlider.UISlider.Value = refLineRenderer.LineRenderer.EndWidth / 2 --initial position of slider

OVC = function()
  refLineRenderer.LineRenderer.EndWidth = (refSlider.UISlider.Value * 2)  -- from 0 to 2
end

refSlider.UISlider.OnValueChanged(OVC)
Space.Host.ExecutingObject.LineRenderer.WidthMultiplier = 1.2
--the below script will make a slider change the Line Renderer's Width Multiplier
thisGameObject = Space.Host.ExecutingObject

refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component

refSlider.UISlider.Value = refLineRenderer.LineRenderer.WidthMultiplier / 5 --initial position of slider

OVC = function()
  refLineRenderer.LineRenderer.WidthMultiplier = (refSlider.UISlider.Value * 5)  -- from 0 to 5
end

refSlider.UISlider.OnValueChanged(OVC)
Space.Host.ExecutingObject.LineRenderer.StartColor = Color.Red
--clicking the object will open a color picker that changes the Line Renderer's Start Color

thisGameObject = Space.Host.ExecutingObject
originalColor = thisGameObject.LineRenderer.StartColor

OnChange = function(SColor) 
  thisGameObject.LineRenderer.StartColor = SColor
end

OnSelect = function(SColor)
  thisGameObject.LineRenderer.StartColor = SColor
end

OnCancel = function()
  thisGameObject.LineRenderer.StartColor = originalColor
end

OnClick = function()
  Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.LineRenderer.EndColor = Color.Blue
--clicking the object will open a color picker that changes the Line Renderer's End Color

thisGameObject = Space.Host.ExecutingObject
originalColor = thisGameObject.LineRenderer.EndColor

OnChange = function(SColor) 
  thisGameObject.LineRenderer.EndColor = SColor
end

OnSelect = function(SColor)
  thisGameObject.LineRenderer.EndColor = SColor
end

OnCancel = function()
  thisGameObject.LineRenderer.EndColor = originalColor
end

OnClick = function()
  Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.LineRenderer.PositionCount = 10
--the below script will make a slider change the Line Renderer's Position Count
thisGameObject = Space.Host.ExecutingObject

refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component

refSlider.UISlider.Value = refLineRenderer.LineRenderer.PositionCount  / 20 --initial position of slider

OVC = function()
  refLineRenderer.LineRenderer.PositionCount  = refSlider.UISlider.Value * 20  -- from 0 to 20
end

refSlider.UISlider.OnValueChanged(OVC)
Space.Host.ExecutingObject.LineRenderer.UseWorldSpace  = true
--clicking this object toggles it's Use World Space option

thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  thisObject.LineRenderer.UseWorldSpace = not   thisObject.LineRenderer.UseWorldSpace

end


thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.LineRenderer.Loop = true
--clicking this object toggles it's Loop option

thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  thisObject.LineRenderer.Loop = not   thisObject.LineRenderer.Loop

end


thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.LineRenderer.NumCornerVertices = 2
--the below script will make a slider change the Line Renderer's Corner Vertices
thisGameObject = Space.Host.ExecutingObject

refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component

refSlider.UISlider.Value = refLineRenderer.LineRenderer.NumCornerVertices  / 10 --initial position of slider

OVC = function()
  refLineRenderer.LineRenderer.NumCornerVertices  = refSlider.UISlider.Value * 10  -- from 0 to 10
end

refSlider.UISlider.OnValueChanged(OVC)
Space.Host.ExecutingObject.LineRenderer.NumCapVertices = 2
--the below script will make a slider change the Line Renderer's End Cap Vertices
thisGameObject = Space.Host.ExecutingObject

refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component

refSlider.UISlider.Value = refLineRenderer.LineRenderer.NumCapVertices  / 20 --initial position of slider

OVC = function()
  refLineRenderer.LineRenderer.NumCapVertices  = refSlider.UISlider.Value * 20  -- from 0 to 10
end

refSlider.UISlider.OnValueChanged(OVC)
Space.Host.ExecutingObject.LineRenderer.TextureMode = 2
--clicking this object toggles between it's 4 Texture Modes

thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  if thisObject.LineRenderer.TextureMode == 3 then
    thisObject.LineRenderer.TextureMode = 0
  else 
    thisObject.LineRenderer.TextureMode = thisObject.LineRenderer.TextureMode + 1
  end
end


thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
Space.Host.ExecutingObject.LineRenderer.Alignment = 1
--clicking this object toggles it's Alignment option between View (0) and Transform Z (1)

thisObject = Space.Host.ExecutingObject

function OnClickFunction()
  if thisObject.LineRenderer.Alignment == 0 then
    thisObject.LineRenderer.Alignment = 1
  else thisObject.LineRenderer.Alignment = 0
  end

end


thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
theGameObject = Space.Host.ExecutingObject.LineRenderer.GameObject
StartColor
EndColor
PositionCount
UseWorldSpace
Loop
NumCornerVertices
NumCapVertices
TextureMode
Alignment
GameObject

SAnimator

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

Rebind

void Rebind ()

Rebind all the animated properties and mesh data with the Animator.

Stop

void Stop ()

Stop the Animator.

SetTime

void SetTime (double time)

Function Description

Parameter
Type
Description

GetTime

double GetTime ()

Function Description

GetNormalizedTime

double GetNormalizedTime (int layer=0)

Normalized time of the State. The integer part is the number of time a state has been looped. The fractional part is the % (0-1) of progress in the current loop.

Parameter
Type
Description

GetLength

double GetLength (int layer=0)

Current duration of the state.

Parameter
Type
Description

GetLoop

bool GetLoop (int layer=0)

Is the state looping.

Parameter
Type
Description

GetFloat

float GetFloat (string name) float GetFloat (int id)

Returns the value of the given float parameter. name: The name of the parameter. id: The id of the parameter.

Parameter
Type
Description

GetBool

bool GetBool (string name) bool GetBool (int id)

Returns the value of the given boolean parameter. name: The name of the parameter. id: The id of the parameter.

Parameter
Type
Description

GetInteger

int GetInteger (string name) int GetInteger (int id)

Returns the value of the given integer parameter. name: The name of the parameter. id: The id of the parameter.

Parameter
Type
Description

ResetTrigger

void ResetTrigger (string name) void ResetTrigger (int id)

Resets the trigger parameter to false.

Parameter
Type
Description

IsParameterControlledByCurve

bool IsParameterControlledByCurve (string name)

bool IsParameterControlledByCurve (int id)

Returns true if a parameter is controlled by an additional curve on an animation.

Parameter
Type
Description

GetLayerName

string GetLayerName (int layerIndex)

Gets name of the layer.

Parameter
Type
Description

GetLayerIndex

int GetLayerIndex (string layerName)

Gets the index of the layer with specified name.

Parameter
Type
Description

GetLayerWeight

float GetLayerWeight (int layerIndex)

Gets the layer's current weight.

Parameter
Type
Description

SetLayerWeight

void SetLayerWeight (int layerIndex, float weight)

Sets the weight of the layer at the given index.

Parameter
Type
Description

IsInTransition

bool IsInTransition (int layerIndex)

Is the specified layer in a transition.

Parameter
Type
Description

CrossFadeInFixedTime

void CrossFadeInFixedTime (string stateName, float transitionDuration)

void CrossFadeInFixedTime (string stateName, float transitionDuration, int layer)

void CrossFadeInFixedTime (string stateName, float transitionDuration, int layer, float fixedTime)

Creates a dynamic transition between the current state and the destination state. The duration and offset in the target state are in fixed time. stateName: The name of the destination state. transitionDuration: The duration of the transition. Value is in seconds. layer: Layer index containing the destination state. If no layer is specified or layer is -1, the first state that is found with the given name or hash will be played. fixedTime: Start time of the current destination state. Value is in seconds. If no explicit fixedTime is specified or fixedTime value is float.NegativeInfinity, the state will either be played from the start if it's not already playing, or will continue playing from its current time and no transition will happen.

Parameter
Type
Description

CrossFade

void CrossFade (string stateName, float transitionDuration)

void CrossFade (string stateName, float transitionDuration, int layer)

void CrossFade (string stateName, float transitionDuration, int layer, float normalizedTime)

Creates a dynamic transition between the current state and the destination state. stateName: The name of the destination state. transitionDuration: The duration of the transition. Value is in source state normalized time. layer: Layer index containing the destination state. If no layer is specified or layer is -1, the first state that is found with the given name or hash will be played. normalizedTime: Start time of the current destination state. Value is in source state normalized time, should be between 0 and 1. If no explicit normalizedTime is specified or normalizedTime value is float.NegativeInfinity, the state will either be played from the start if it's not already playing, or will continue playing from its current time and no transition will happen.

Parameter
Type
Description

PlayInFixedTime

void PlayInFixedTime (string stateName, int layer) void PlayInFixedTime (string stateName) void PlayInFixedTime (string stateName, int layer, float fixedTime)

Plays a state. The offset in the target state is in fixed time. stateName: The name of the state to play. Layer index containing the destination state. If no layer is specified or layer is -1, the first state that is found with the given name or hash will be played.

Parameter
Type
Description

Play

void Play (string stateName)

void Play (string stateName, int layer)

void Play (string stateName, int layer, float normalizedTime)

Plays a state.

Parameter
Type
Description

StartPlayback

void StartPlayback ()

Sets the animator in playback mode.

StopPlayback

void StopPlayback ()

Stops the animator playback mode. When playback stops, the avatar resumes getting control from game logic.

StartRecording

void StartRecording ()

Sets the animator in recording mode. The recording will continue until the user calls StopRecording. Maximum 10,000 frames. Note it is not possible to start playback until a call to StopRecording is made

StopRecording

void StopRecording ()

Stops animator record mode.

Update

void Update (float deltaTime)

Function Description

Parameter
Type
Description

SetTrigger

void SetTrigger (string trigger)

void SetTrigger (int id)

Sets a trigger parameter to active. A trigger parameter is a bool parameter that gets reset to false when it has been used in a transition. For state machines with multiple layers, the trigger will only get reset once all layers have been evaluated, so that the layers can synchronize their transitions on the same parameter.

Parameter
Type
Description

SetFloat

void SetFloat (string name, float value)

void SetFloat (string name, float value, float dampTime, float deltaTime)

void SetFloat (int id, float value)

void SetFloat (int id, float value, float dampTime, float deltaTime)

Send float values to the Animator to affect transitions. dampTime: The damper total time. deltaTime: The delta time to give to the damper.

Parameter
Type
Description

SetBool

void SetBool (int id, bool value) void SetBool (string name, bool value)

Sets the value of a boolean parameter.

Parameter
Type
Description

SetInteger

void SetInteger (string name, int value) void SetInteger (int id, int value)

Sets the value of the given integer parameter.

Parameter
Type
Description

StringToHash

int StringToHash (string name)

Generates an parameter id from a string. Ids are used for optimized setters and getters on parameters.

Parameter
Type
Description

GetCurrentAnimatorStateInfo

GetCurrentAnimatorStateInfo (int Layerindex)

Returns an SAnimatorStateInfo with the information on the current state..

Parameter
Type
Description

Properties

Controller

Controller get set

The Animator Controller resource of this Animator

Avatar

Avatar get set

Gets/Sets the current Avatar.

ApplyRootMotion

bool ApplyRootMotion get set

Should root motion be applied?

Root motion is the effect where an object's entire mesh moves away from its starting point but that motion is created by the animation itself rather than by changing the Transform position.

PlaybackTime

float PlaybackTime get set

Property Description

Enabled

bool Enabled get set

Whether the Animator component is enabled or not

Parameters

string[] Parameters get

The AnimatorControllerParameter list used by the animator.

GameObject

GameObject get

Returns a reference to the GameObject of this component.

string (int layerIndex)

int (string layerName)

float (int layerIndex)

void (int layerIndex, float weight)

bool (int layerIndex)

void (string stateName, float transitionDuration, int layer)

void (string stateName, float transitionDuration)

void (string stateName, float transitionDuration, int layer, float fixedTime)

void (string stateName, float transitionDuration, int layer)

void (string stateName, float transitionDuration)

void (string stateName, float transitionDuration, int layer, float normalizedTime)

void (string stateName, int layer)

void (string stateName)

void (string stateName, int layer, float fixedTime)

void (string stateName, int layer)

void (string stateName)

void (string stateName, int layer, float normalizedTime)

void ()

void ()

void ()

void ()

void (float deltaTime)

void (string trigger)

void (int id)

void (string name, float value, float dampTime, float deltaTime)

void (int id, float value)

void (int id, float value, float dampTime, float deltaTime)

void (string name, float value)

void (int id, bool value)

void (string name, bool value)

void (string name, int value)

void (int id, int value)

int (string name)

SAnimatorStateInfo (int Layerindex)

void Rebind ()

void Stop ()

void SetTime (double time)

double GetTime ()

double GetNormalizedTime (int layer=0)

double GetLength (int layer=0)

bool GetLoop (int layer=0)

float GetFloat (string name)

float GetFloat (int id)

bool GetBool (string name)

bool GetBool (int id)

int GetInteger (string name)

int GetInteger (int id)

void ResetTrigger (string name)

void ResetTrigger (int id)

SResource Controller get set

SResource Avatar get set

bool ApplyRootMotion get set

float PlaybackTime get set

bool Enabled get set

string[] Parameters get

stateName

string

The name of the state to play.

layer

int

Layer index containing the destination state. If no layer is specified or layer is -1, the first state that is found with the given name or hash will be played.

normalizedTime

float

Start time of the current destination state. Value is in normalized time. If no explicit normalizedTime is specified or value is float.NegativeInfinity, the state will either be played from the start if it's not already playing, or will continue playing from its current time.

SAnimatorStateInfo
SResource
SResource
SGameObject

bool (string name)

bool (int id)

Space.Host.ExecutingObject.Animator.Rebind()
Space.Host.ExecutingObject.Animator.Stop()
Space.Host.ExecutingObject.Animator.SetTime(1.0)
layerStateTime = Space.Host.ExecutingObject.Animator.GetTime(0)
layerStateNormalizedTime = Space.Host.ExecutingObject.Animator.GetNormalizedTime(0)
layerStateLength = Space.Host.ExecutingObject.Animator.GetLength(1)
layerStateLoop = Space.Host.ExecutingObject.Animator.GetLoop(0)
getParam = Space.Host.ExecutingObject.Animator.GetFloat("paramName")

-- or 

 paramID = Space.Host.ExecutingObject.Animator.StringToHash("paramName")
getParam = Space.Host.ExecutingObject.Animator.GetFloat(paramID)
--clicking the object will toggle it's Animator's "flySpeed" float parameter between 0.0 and 5.0
thisObject = Space.Host.ExecutingObject

OnClick = function()
if thisObject.Animator.GetFloat("flySpeed") == 0.0 then
  thisObject.Animator.SetFloat("flySpeed", 5.0) 
else 
  thisObject.Animator.SetFloat("flySpeed", 0.0) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
--clicking the object will toggle it's Animator's "flySpeed" float parameter between 0.0 and 5.0
--this script uses parameter ID instead of string (StringToHash function gets the ID)

thisObject = Space.Host.ExecutingObject
paramID = thisObject.Animator.StringToHash("flySpeed")

OnClick = function()
if thisObject.Animator.GetFloat(paramID) == 0.0 then
  thisObject.Animator.SetFloat(paramID, 5.0) 
else 
  thisObject.Animator.SetFloat(paramID, 0.0) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
isFlying = Space.Host.ExecutingObject.Animator.GetBool("IsFlying")

--or

ID = Space.Host.ExecutingObject.Animator.StringToHash("isFlying")
isFlying = Space.Host.ExecutingObject.Animator.GetBool(ID)
--clicking the object will toggle it's "isFlying" bool parameter between true and false
thisObject = Space.Host.ExecutingObject

OnClick = function()
if thisObject.Animator.GetBool("isFlying") == true then
  thisObject.Animator.SetBool("isFlying", false) 
else 
  thisObject.Animator.SetBool("isFlying", true) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
--clicking the object will toggle it's "isFlying" bool parameter between true and false
--this script uses parameter ID instead of string (StringToHash function gets the ID)
thisObject = Space.Host.ExecutingObject

OnClick = function()
  parameterID = thisObject.Animator.StringToHash("isFlying")
  
if thisObject.Animator.GetBool(parameterID) == true then
  thisObject.Animator.SetBool(parameterID, false) 
else 
  thisObject.Animator.SetBool(parameterID, true) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
getParam = Space.Host.ExecutingObject.Animator.GetInteger("paramName")
--or
 paramID = Space.Host.ExecutingObject.Animator.StringToHash("paramName")
getParam = Space.Host.ExecutingObject.Animator.GetInteger(paramID)
--clicking the object will toggle it's Animator's "jumpHeight" int parameter between 0 and 5

thisObject = Space.Host.ExecutingObject

OnClick = function()
if thisObject.Animator.GetInteger("jumpHeight") == 0 then
  thisObject.Animator.SetInteger("jumpHeight", 1) 
else 
  thisObject.Animator.SetInteger("jumpHeight", 0) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
--clicking the object will toggle it's Animator's "jumpHeight" int parameter between 0 and 5
--this script uses parameter ID instead of string (StringToHash function gets the ID)

thisObject = Space.Host.ExecutingObject
paramID = thisObject.Animator.StringToHash("jumpHeight")

OnClick = function()
if thisObject.Animator.GetInteger(paramID ) == 0 then
  thisObject.Animator.SetInteger(paramID , 1) 
else 
  thisObject.Animator.SetInteger(paramID , 0) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Animator.ResetTrigger("parameterName")
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("parameterName")
Space.Host.ExecutingObject.Animator.ResetTrigger(paramID)
-- when object is clicked, "clickedTrigger" trigger parameter will be set and initial trigger cleared
thisObject = Space.Host.ExecutingObject


OnClick = function()
thisObject.Animator.ResetTrigger("initialTrigger")
thisObject.Animator.SetTrigger("clickedTrigger")
end
  

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
-- when object is clicked, "clickedTrigger" trigger parameter will be set and initial trigger cleared
thisObject = Space.Host.ExecutingObject

initialID = thisObject.Animator.StringToHash("initialTrigger")
clickedID = thisObject.Animator.StringToHash("clickedTrigger")

OnClick = function()
thisObject.Animator.ResetTrigger(initialID)
thisObject.Animator.SetTrigger(clickedID)
end
  

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
paramCurve = Space.Host.ExecutingObject.Animator.IsParameterControlledByCurve("parameterName")
layerName = Space.Host.ExecutingObject.Animator.GetLayerName(1)
layerIndex = Space.Host.ExecutingObject.Animator.GetLayerIndex("Layer Name")
layerIndex = Space.Host.ExecutingObject.Animator.GetLayerWeight("Layer Name")
Space.Host.ExecutingObject.Animator.SetLayerWeight(0,2.0)
--clicking the object will toggle the Layer Weight of your second layer (index 1) between 0.0 and 1.0

thisObject = Space.Host.ExecutingObject

OnClick = function()
if thisObject.Animator.GetLayerWeight(1) == 0 then
  thisObject.Animator.SetLayerWeight(1, 1.0)
else 
  thisObject.Animator.SetLayerWeight(1, 0.0)
end

end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
layerTransition = Space.Host.ExecutingObject.Animator.IsInTransition(0)
Space.Host.ExecutingObject.Animator.CrossFadeInFixedTime("State Name", 15.0)
Space.Host.ExecutingObject.Animator.CrossFadeInFixedTime("State Name", 15.0, 0)
Space.Host.ExecutingObject.Animator.CrossFadeInFixedTime("State Name", 15.0, 0 , 0.0)
--clicking the object will make it's animator crossfade from current state to the middle of "Second State" (on the second layer) in 3 seconds
thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.Animator.CrossFadeInFixedTime("Second State", 3.0, 1, 0.5)
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Animator.CrossFade("State Name", 3.0)
Space.Host.ExecutingObject.Animator.CrossFade("State Name", 3.0, 0)
Space.Host.ExecutingObject.Animator.CrossFade("State Name", 3.0, 0 , 0.0)
--clicking the object will make it's animator crossfade from current state to the middle of "Second State" (on the second layer)
--Crossfade duration will be triple the length of Source state
thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.Animator.CrossFade("Second State", 3.0, 1, 0.5)
end

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Animator.PlayInFixedTime("State Name")
Space.Host.ExecutingObject.Animator.PlayInFixedTime("State Name", 0)
Space.Host.ExecutingObject.Animator.PlayInFixedTime("State Name", 0, 0.0)
--clicking the object will make it's animator play the "Second State", on the second Layer, and starting half a second in
thisObject = Space.Host.ExecutingObject

OnClick = function()
thisObject.Animator.PlayInFixedTime("Second State",1,0.5) --add "Second State" to the second Layer in Animator Controller 
end


thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Animator.Play("Run")
Space.Host.ExecutingObject.Animator.Play("Run", 0)
Space.Host.ExecutingObject.Animator.Play("Run", 0, 0.5)
Space.Host.ExecutingObject.Animator.StartPlayback()
Space.Host.ExecutingObject.Animator.StopPlayback()
Space.Host.ExecutingObject.Animator.StartRecording()
Space.Host.ExecutingObject.Animator.StopRecording()
Space.Host.ExecutingObject.Animator.Update()
Space.Host.ExecutingObject.SetTrigger("TheTriggerName")
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("TheTriggerName")
Space.Host.ExecutingObject.SetTrigger(paramID)
 Space.Host.ExecutingObject.Animator.SetFloat("parameterName", 2.2)
--or
Space.Host.ExecutingObject.Animator.SetFloat("parameterName", 2.2,2.0,Space.DeltaTime)
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("parameterName")
Space.Host.ExecutingObject.Animator.SetFloat(paramID, 2.2)
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("parameterName")
Space.Host.ExecutingObject.Animator.SetFloat(paramID, 2.2,2.0,Space.DeltaTime)
--clicking the object will make it's Animator damp transition it's "danceSpeed" property from 0.0 to 5.0

thisObject = Space.Host.ExecutingObject

OnClick = function()
  Space.Host.StartCoroutine(function()
      while thisObject.Animator.GetFloat("danceSpeed") < 5.0 do
thisObject.Animator.SetFloat("danceSpeed", 5.0, 1.0, Space.DeltaTime) 
coroutine.yield(0)
      end

end)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Animator.SetBool("IsFlying", true)
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("parameterName")
Space.Host.ExecutingObject.Animator.SetFloat(paramID, 2.2)
--clicking the object will toggle it's "isFlying" bool parameter between true and false
thisObject = Space.Host.ExecutingObject

OnClick = function()
if thisObject.Animator.GetBool("isFlying") == true then
  thisObject.Animator.SetBool("isFlying", false) 
else 
  thisObject.Animator.SetBool("isFlying", true) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Animator.SetInteger("iParam", 2)
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("iParam")
Space.Host.ExecutingObject.Animator.SetInteger(paramID, 2)
--clicking the object will toggle it's Animator's "jumpHeight" int parameter between 0 and 5

thisObject = Space.Host.ExecutingObject

OnClick = function()
if thisObject.Animator.GetInteger("jumpHeight") == 0 then
  thisObject.Animator.SetInteger("jumpHeight", 1) 
else 
  thisObject.Animator.SetInteger("jumpHeight", 0) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
ID = Space.Host.ExecutingObject.Animator.StringToHash("isFlying")
--clicking the object will toggle it's "isFlying" bool parameter between true and false
--this script uses parameter ID instead of string (StringToHash function gets the ID)
thisObject = Space.Host.ExecutingObject

OnClick = function()
  parameterID = thisObject.Animator.StringToHash("isFlying")
  
if thisObject.Animator.GetBool(parameterID) == true then
  thisObject.Animator.SetBool(parameterID, false) 
else 
  thisObject.Animator.SetBool(parameterID, true) 
end

end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
Space.Host.ExecutingObject.Animator.Controller = Space.GetResource("newController")
currentAvatar = thisObject.Animator.Avatar 
-- when object is clicked, it's Animator's Avatar will be changed to an alternate one
thisObject = Space.Host.ExecutingObject

alternateAvatar = Space.GetResource("altavatar") -- add Avatar to Scripting Runtime resources section

OnClick = function()
thisObject.Animator.Avatar = alternateAvatar
end
  

thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.ExecutingObject.Animator.ApplyRootMotion = true
--clicking this object will Enable/Disable it's Root Motion
thisGameObject = Space.Host.ExecutingObject.Animator


OnClick = function()
animator.ApplyRootMotion =  not animator.ApplyRootMotion
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
pace.Host.ExecutingObject.Animator.PlaybackTime = 0.5
Space.Host.ExecutingObject.Animator.Enabled = true
--clicking this object will Enable/Disable it's Animator component
thisGameObject = Space.Host.ExecutingObject
animator = thisGameObject.Animator


OnClick = function()
animator.Enabled =  not animator.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
parameters = Space.Host.ExecutingObject.Animator.Parameters
for i=1,#parameters do Space.Log(parameters[i]) end --prints all parameters
theGameObject = Space.Host.ExecutingObject.Animator.GameObject
IsParameterControlledByCurve
IsParameterControlledByCurve
GetLayerName
GetLayerIndex
GetLayerWeight
SetLayerWeight
IsInTransition
CrossFadeInFixedTime
CrossFadeInFixedTime
CrossFadeInFixedTime
CrossFade
CrossFade
CrossFade
PlayInFixedTime
PlayInFixedTime
PlayInFixedTime
Play
Play
Play
StartPlayback
StopPlayback
StartRecording
StopRecording
Update
SetTrigger
SetTrigger
SetFloat
SetFloat
SetFloat
SetFloat
SetBool
SetBool
SetInteger
SetInteger
StringToHash
GetCurrentAnimatorStateInfo