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...
bool Enabled get set
Returns true if the Audio Reactive Material Enabled.
Target get set
Property Description
OriginalMaterial get set
Property Description
TargetMaterial get set
Property Description
GameObject get
Returns a reference to the GameObject of this component.
bool Enabled get set
SMaterial Target get set
SMaterial OriginalMaterial get set
SMaterial TargetMaterial get set
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)Space.Host.ExecutingObject.AudioReactiveMaterial.Target = AMaterialSpace.Host.ExecutingObject.AudioReactiveMaterial.OriginalMaterial = AMaterialSpace.Host.ExecutingObject.AudioReactiveMaterial.TargetMaterial = AMaterialtheGameObject = Space.Host.ExecutingObject.AudioReactiveMaterial.GameObject Center get set
The position of the center of the Box Collider.
Size get set
The size of the box.
bool Enabled get set
Enabled Colliders will collide with other Colliders, disabled Colliders won't.
bool IsTrigger get set
Is the collider a trigger?
GameObject get
Returns a reference to the GameObject of this component.
bool Enabled get set
Returns true if the Audio Reactive Animation Enabled.
Target get set
The target Animator which the Audio Reactive Animation is affecting.
string Parameter get set
The Parameter value which the Audio Reactive Animation is affecting in the target Animator.
GameObject get
Returns a reference to the GameObject of this component.
SVector Center get set
SVector Size get set
bool Enabled get set
bool IsTrigger get set
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)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)bool Enabled get set
string Parameter get set
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)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.GameObjectTargetAnimator = 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.GameObjectbool Enabled get set
Property Description
Target get set
Property Description
bool Position get set
Property Description
MinPosition get set
Property Description
MaxPosition get set
Property Description
bool Rotation get set
Property Description
MinRotation get set
Property Description
MaxRotation get set
Property Description
bool Scale get set
Property Description
MinScale get set
Property Description
MaxScale get set
Property Description
GameObject get
Returns a reference to the GameObject of this component.
float Alpha get set
Set the alpha of the group.
bool BlocksRaycasts get set
Does this group block raycasting (allow collision)?
bool IgnoreParentGroups get set
Should the group ignore parent groups?
bool Interactable get set
Is the group interactable (are the elements beneath the group enabled)?
GameObject get
Returns a reference to the GameObject of this component.
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
float Alpha get set
bool BlocksRaycasts get set
bool IgnoreParentGroups get set
bool Interactable get set
Space.Host.CanvasGroup.Alpha = 1.0Space.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.TargetSpace.Host.ExecutingObject.AudioReactiveParticleSystem.Position = trueSpace.Host.ExecutingObject.AudioReactiveParticleSystem.MinPosition = Vector.New(0,0,0)Space.Host.ExecutingObject.AudioReactiveParticleSystem.MaxPosition = Vector.New(10,10,10)Space.Host.ExecutingObject.AudioReactiveParticleSystem.Rotation = trueSpace.Host.ExecutingObject.AudioReactiveParticleSystem.MinRotation = Vector.New(0,0,0)Space.Host.ExecutingObject.AudioReactiveParticleSystem.MaxRotation = Vector.New(10,10,10)Space.Host.ExecutingObject.AudioReactiveParticleSystem.Scale = trueSpace.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.GameObjectSpace.Host.CanvasGroup.BlocksRaycasts = trueSpace.Host.CanvasGroup.IgnoreParentGroups = trueSpace.Host.CanvasGroup.Interactable = truetheGameObject = Space.Host.ExecutingObject.CanvasGroup.GameObjectSAnimationState ()
SAnimationState (string state)
void (string animation, float targetWeight=1.0F, float fadeLength=0.3F)
void (string animation, float fadeLength=0.3F)
SAnimationState (string animation, float fadeLength=0.3F, bool playNow=false)
int ()
bool (string animation)
bool ()
bool (string animation)
SAnimationState (string animation, bool playNow=false)
void (string animation)
void ()
void ()
void (string animation)
bool get set
IDictionary< string, SAnimationState > get
SAnimationState GetState () SAnimationState GetState (string state)
Returns the SAnimationState for the default animation clip.
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.
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.
SAnimationState 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.
int GetClipCount ()
Get the number of clips currently assigned to this animation.
bool IsPlaying (string animation)
Is the animation named name playing?
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.
SAnimationState 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.
void Rewind (string animation)
Rewinds the animation named name.
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.
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.
bool Enabled get set
Whether this component is enabled or not.
IDictionary< string, SAnimationState > States get
Returns a table of SAnimationState names and references
SGameObject GameObject get
Returns a reference to the GameObject of this component.
void ()
void ()
void ()
bool get set
SGameObject get
void SetLayoutHorizontal ()
Function Description
Space.Host.ExecutingObject.ContentSizeFitter.SetLayoutHorizontal()void SetLayoutVertical ()
Function Description
void RefreshLayout ()
Function Description
bool Enable get set
Property Description
SGameObject GameObject get
Property Description
void SwitchEventType (int typeNumber)
Function Description
void ChangeRange (int range)
Function Description
int Range get set
Property Description
GameObject get
Property Description
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.StatestheGameObject = Space.Host.ExecutingObject.Animation.GameObjectSpace.Host.ExecutingObject.ContentSizeFitter.SetLayoutVertical()Space.Host.ExecutingObject.ContentSizeFitter.RefreshLayout()Space.Host.ExecutingObject.ContentSizeFitter.Enable = truetheGameObject = Space.Host.ExecutingObject.ContentSizeFitter.GameObjectvoid SwitchEventType (int typeNumber)
void ChangeRange (int range)
int Range get set
SGameObject GameObject get
Space.Host.ExecutingObject.EventCalendar.SwitchEventType(1)Space.Host.ExecutingObject.EventCalendar.ChangeRange(3)Space.Host.ExecutingObject.EventCalendar.Range = 3theGameObject = Space.Host.ExecutingObject.EventCalendar.GameObjectbool 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
bool Enabled get set
Whether the Audio Reactive Transform component is enabled or not.
SGameObject Target get set
The target GameObject which will be affected by the Audio Reactive Transform.
bool Position get set
Whether or not the target's position will be affected by the Audio Reactive Transform.
SVector MinPosition get set
Returns MinPosition value of the Audio Reactive Transform.
SVector MaxPosition get set
Returns MaxPosition value of the Audio Reactive Transform.
bool Rotation get set
Whether or not the target's rotation will be affected by the Audio Reactive Transform.
SVector MinRotation get set
Returns MinRotation value of the Audio Reactive Transform.
SVector MaxRotation get set
Returns MaxRotation value of the Audio Reactive Transform.
bool Scale get set
Whether or not the target's scale will be affected by the Audio Reactive Transform.
SVector MinScale get set
Returns MinScale value of the Audio Reactive Transform.
SVector MaxScale get set
Returns MaxScale value of the Audio Reactive Transform.
SGameObject GameObject get
Returns a reference to the GameObject of this component.
void (string name)
bool get set
string[] get
string get
SGameObject get
void InvokeEvent (string name)
Invoke the event with its name
Space.Host.ExecutingObject.Events.InvokeEvent("EventName")bool Enabled get set
Whether the scriptingEvents component is enabled or not
string[] Events get
Returns a list of events
string ComponentName get
The name of this component.
SGameObject GameObject get
Property Description
bool get set
bool get set
SGameObject get
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.OnClickbool IsTrigger get set
Set Collider as a trigger.
SGameObject GameObject get
Property Description
bool get set
bool get set
SResource get set
SColor get set
SGameObject get
bool RaycastTarget get set
Enable Raycast Target.
Space.Host.ExecutingObject.UIRawImage.RaycastTarget = truebool Maskable get set
To check if the graphic is maskable.
SResource Texture get set
The RawImage's texture.
SColor Color get set
Base color of the Graphic.
SGameObject GameObject get
Property Description
bool get set
string get set
SResource get set
SGameObject get
bool Enabled get set
Get or set whether the tool tip component is Enabled.
Space.Host.ExecutingObject.UIToolTipHint.Enabled = truestring Text get set
Get or set the string value this tool tip displays.
SResource Texture get set
Get or set the tooltip's texture.
SGameObject GameObject get
Property Description
void ()
SVector get set
SVector get set
SGameObject get
void RenderProbe ()
Refreshes the probe's cubemap.
Space.Host.ExecutingObject.ReflectionProbe.RenderProbe()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.
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.
SGameObject GameObject get
Property Description
bool Enabled get set
Whether the Audio Reactive component is enabled or not.
int BandMin get set
The Band Min property of an Audio Reactive component.
int BandMax get set
The Band Max property of an Audio Reactive component.
float BPMWindow get set
The BPM Window property of an Audio Reactive component.
float LimitIncrease get set
The Limit Increase property of an Audio Reactive component.
float LimitDecrease get set
The Limit Decrease property of an Audio Reactive component.
float MinValue get set
The Min Value property of an Audio Reactive component.
float MaxValue get set
The Max Value property of an Audio Reactive component.
int Mode get set
The Mode property of an Audio Reactive component. Band is 0, and BMP is 1.
float Power get
Property Description
GameObject get
Returns a reference to the GameObject of this component.
object GetVariable (string name)
Return the object of the variable.
void SetVariable (string name, DynValue property, bool persistent=false)
Set properties to variable.
bool Enabled get set
Is the ScriptingData component Enabled?
string[] Variables get
Property Description
string ComponentName get
The name of this component.
GameObject get
Property Description
void StoreCustomData (string key, string value)
Function Description
string GetCustomData (string key)
Function Description
int InventoryItemID get
Return the inventory ID of furniture.
Floor get
Return an SRoomFloor component of the floor this furniture is placed on.
MainCollider get
Property Description
GameObject get
Property Description
bool Enabled get set
Status of enable or disable room floor component
string Name get
Name of this floor
string Description get
Description of this floor.
bool IsDefaultFloor get
Is this default floor?
[] Furniture get
Get all furniture game objects
int Owner get
Return the ID of the user account that owns this room floor, if any.
GameObject get
Property Description
void Play ()
Instantiates a Playable using the provided PlayableAsset and starts playback.
void Stop ()
Stop playback of the current Playable and destroys the corresponding graph.
void Pause ()
Pause playback of the currently running playable.
void Resume ()
Resume playing a paused playable.
int State get
The current playing state of the component.
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.
double InitialTime get set
The time at which the Playable should start when first played.
double Duration get
The duration of the Playable in seconds.
GameObject get
Property Description
bool CarveOnlyStationary get set
When enabled, the obstacle is carved only when it is stationary. (Only can enabled after carve was ticked).
bool Carving get set
When the Carve checkbox gets ticked, the Nav Mesh Obstacle creates a hole in the NavMesh.
SVector Center get set
Center of the obstacle geometry relative to the transform position.
float Height get set
Height of the capsule. (Property of Capsule shape).
SVector Size get set
Size of the box. (Property of Box shape).
float Radius get set
Property Description
int Shape get set
Property Description
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)
float TimeToStationary get set
The time to wait until the obstacle is treated as stationary. (Only can take effect after carve was ticked).
GameObject get
Property Description
GetResource (string name)
Returns the SResource with the specified name, or else returns nil if not found.
bool Enabled get set
Return whether the ScriptingResources component is Enabled or not
SResource[] Resources get
Returns an array of all resources contained within this component.
GameObject get
Property Description
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.GameObjectSpace.Host.ExecutingObject.Events.Enabled = trueeventNames = Space.Host.ExecutingObject.Events.EventscomponentName = Space.Host.ExecutingObject.Events.ComponentNametheGameObject = Space.Host.ExecutingObject.Events.GameObjectSpace.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.GameObjectSpace.Host.ExecutingObject.UIRawImage.Maskable = trueSpace.Host.ExecutingObject.UIRawImage.Texture = Space.GetResource("Resource Name")Space.Host.ExecutingObject.UIRawImage.Color = Color.RedtheGameObject = Space.Host.ExecutingObject.UIRawImage.GameObject Space.Host.ExecutingObject.UIToolTipHint.Text = "AToolTip"Space.Host.ExecutingObject.UIToolTipHint.Texture = Space.GetResource("ResourceName")theGameObject = Space.Host.ExecutingObject.UIToolTipHint.GameObjectvectorCenter = Space.Host.ExecutingObject.ReflectionProbe.CentervectorSize = Space.Host.ExecutingObject.ReflectionProbe.SizetheGameObject = Space.Host.ExecutingObject.ReflectionProbe.GameObjectbool Enabled get set
int BandMin get set
int BandMax get set
float BPMWindow get set
float LimitIncrease get set
float LimitDecrease get set
float MinValue get set
float MaxValue get set
int Mode get set
virtual float Power get
object GetVariable (string name)
void SetVariable (string name, DynValue property, bool persistent=false)
bool Enabled get set
string[] Variables get
string ComponentName get
SGameObject GameObject get
void StoreCustomData (string key, string value)
string GetCustomData (string key)
int InventoryItemID get
SRoomFloor Floor get
SCollider MainCollider get
SGameObject GameObject get
bool Enabled get set
string Name get
string Description get
bool IsDefaultFloor get
SGameObject[] Furniture get
int Owner get
SGameObject GameObject get
Space.Host.ExecutingObject.Floor.Enabled = falsevoid Play ()
void Stop ()
void Pause ()
void Resume ()
int State get
double Time get set
double InitialTime get set
double Duration get
SGameObject GameObject get
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
SResource GetResource (string name)
bool Enabled get set
SResource[] Resources get
SGameObject GameObject get
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.")
endSpace.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 = 1theGameObject = Space.Host.ExecutingObject.AudioReactive.GameObjectSpace.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.VariablescomponentName = Space.Host.ExecutingObject.Data.ComponentNametheGameObject = Space.Host.ExecutingObject.Data.GameObjectSpace.Host.ExecutingObject.Furniture.StoreCustomData("AKey", "AValue")theValue = Space.Host.ExecutingObject.Furniture.GetCustomData("AKey")inventoryID = Space.Host.ExecutingObject.Furniture.InventoryItemIDsRoomFloor = Space.Host.ExecutingObject.Furniture.Floorcollider = Space.Host.ExecutingObject.Furniture.MainCollidertheGameObject = Space.Host.ExecutingObject.Furniture.GameObjectSpace.Host.ExecutingObject.Floor.NamefloorDescription = Space.Host.ExecutingObject.Floor.DescriptionisDefault = Space.Host.ExecutingObject.Floor.IsDefaultFloorfurnitureInFloor = Space.Host.ExecutingObject.Floor.FurnitureownerID = Space.Host.ExecutingObject.Floor.OwnertheGameObject = Space.Host.ExecutingObject.Floor.GameObjectSpace.Host.ExecutingObject.Director.Play()Space.Host.ExecutingObject.Director.Stop()Space.Host.ExecutingObject.Director.Pause()Space.Host.ExecutingObject.Director.Resume()intState = Space.Host.ExecutingObject.Director.StateSpace.Host.ExecutingObject.Director.Time = 10Space.Host.ExecutingObject.Director.Time = 2duration = Space.Host.ExecutingObject.Director.DurationtheGameObject = Space.Host.ExecutingObject.Director.GameObjectSpace.Host.ExecutingObject.NavMeshObstacle.CarveOnlyStationary = trueSpace.Host.ExecutingObject.NavMeshObstacle.Carving = trueSpace.Host.ExecutingObject.NavMeshObstacle.Center = Vector.New(0,0,0)Space.Host.ExecutingObject.NavMeshObstacle.Height = 40Space.Host.ExecutingObject.NavMeshObstacle.Size = Vector.New(5,10,15)Space.Host.ExecutingObject.NavMeshObstacle.Radius = 10Space.Host.ExecutingObject.NavMeshObstacle.Shape = 1Space.Host.ExecutingObject.NavMeshObstacle.MoveThreshold = 5Space.Host.ExecutingObject.NavMeshObstacle.TimeToStationary = 5.0theGameObject = Space.Host.ExecutingObject.NavMeshObstacle.GameObjectSpace.Host.ExecutingObject.Resources.Enabled = truearrayOfResources = Space.Host.ExecutingObject.Resources.ResourcestheGameObject = Space.Host.ExecutingObject.Resources.GameObjectbool get set
bool get set
float? get set
float?? get set
float get set
SGameObject get
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()
bool IsGlobal get set
Should this volume be applied to the whole scene?
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.
float?? Weight get set
The total weight of this volume in the scene. 0 means it won't do anything, 1 means full effect.
float Priority get set
The volume priority in the stack. Higher number means higher priority. Negative values are supported.
SGameObject GameObject get
Property Description
SVector get set
float get set
bool get set
bool get set
SGameObject get
SVector Center get set
The center of the sphere in the object's local space.
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)
float Radius get set
The radius of the sphere measured in the object's local space.
bool Enabled get set
Enabled Colliders will collide with other Colliders, disabled Colliders won't.
bool IsTrigger get set
Is the collider a trigger?
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
bool IsRootCanvas get
The avoidance radius for the agent.
float ScaleFactor get set
Scales all UI elements in the Canvas by this factor.
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.
bool PixelPerfect get set
Should the UI be rendered without antialiasing for precision?
float PlaneDistance get set
The distance at which the UI plane should be placed in front of the camera.
int SortingOrder get set
Canvas' order within a sorting layer.
int TargetDisplay get set
For Overlay mode, display index on which the UI canvas will appear.
float NormalizedSortingGridSize get set
The normalized grid size that the canvas will split the renderable area into.
SGameObject GameObject get
Property Description
void (string eventName)
void (string eventName)
bool get set
bool get
string get set
bool get
int get
string[] get
SGameObject get
void SendEvent (string eventName)
Send a networking event event that will be received by other components in the scene with the same network name.
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.
bool Enabled get set
Whether the simple networking component is Enabled or not
bool Instanced get
Returns whether this networking component is instanced or not.
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.
bool Ready get
Return whether the networking component is ready to send or not (is initialized).
int EventCount get
Return the number of events this component is waiting to receive.
string[] EventNames get
Return a list of names of events that this component will receive.
SGameObject GameObject get
Property Description
SUIRaycastResult ()
int get
int get
SGameObject get
SUIRaycastResult Raycast ()
Perform the raycast against the list of graphics associated with the Canvas and returns first UI raycast result.
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.
int SortOrderPriority get
Priority of the raycaster based upon render orderPriority of the raycaster based upon sort order.
int RenderOrderPriority get
Priority of the raycaster based upon render order.
SGameObject GameObject get
Property Description
float BendingStiffness get set
Bending stiffness of cloth.
float CollisionMassScale get set
Increase the mass of colliding particles.
bool EnableContinuousCollision get set
Enable continuous collision to improve collision stability.
bool Enabled get set
Enable or disable components.
ExternalAcceleration get set
A constant external acceleration applied to the cloth.
float Friction get set
Return the friction of the cloth when colliding with the character.
RandomAcceleration get set
A constant external acceleration applied to the cloth.
float StretchingStiffness get set
Stretching stiffness of the cloth.
bool UseGravity get set
Stretching stiffness of the cloth.
GameObject get
Property Description
void OnValueChanged (Closure callback)
Handling for when the scrollbar value is changed.
float Size get set
The size of the scrollbar handle where 1 means it fills the entire scrollbar.
float Value get set
The current value of the scrollbar, between 0 and 1.
int NumberOfSteps get set
Property Description
NormalColor get set
Property Description
HighlightedColor get set
Property Description
PressedColor get set
Property Description
DisabledColor get set
Property Description
float ColorMultiplier get set
Property Description
GameObject get
Property Description
bool Enabled get set
Is this virtual camera enabled?
float FieldOfView get set
Field of view of this virtual camera.
float Dutch get set
Dutch of view of this virtual camera. In degrees.
float NearClip get set
The near clip plane of this virtual camera.
float FarClip get set
The far clip plane of this virtual camera.
float OrthographicSize get set
The orthographic size of this virtual camera.
int Priority get set
The priority of this virtual camera. Higher priority cameras will be used over lower priority cameras when conflicted.
Follow get set
The object that this virtual camera should be following.
LookAt get set
The object that this virtual camera should be looking at.
GameObject get
Property Description
Space.Host.ExecutingObject.PostProcessVolume.IsGlobal = trueSpace.Host.ExecutingObject.PostProcessVolume.BlendDistance = 0Space.Host.ExecutingObject.PostProcessVolume.Weight = 1Space.Host.ExecutingObject.PostProcessVolume.Priority = 100theGameObject = Space.Host.ExecutingObject.PostProcessVolume.GameObjectSpace.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.GameObjectIsRootCanvas = Space.Host.ExecutingObject.UICanvas.IsRootCanvasSpace.Host.ExecutingObject.UICanvas.ScaleFactor = 2.0Space.Host.ExecutingObject.UICanvas.ReferencePixelsPerUnit = 50.0Space.Host.ExecutingObject.UICanvas.PixelPerfect = trueSpace.Host.ExecutingObject.UICanvas.PlaneDistance = 2.0Space.Host.ExecutingObject.UICanvas.SortingOrder = 2.0Space.Host.ExecutingObject.UICanvas.TargetDisplay = 1Space.Host.ExecutingObject.UICanvas.NormalizedSortingGridSize = 5.0theGameObject = Space.Host.ExecutingObject.UICanvas.GameObjectSpace.Host.ExecutingObject.Networking.SendEvent("Light On")Space.Host.ExecutingObject.Networking.ReceiveEvent("Light On")Space.Host.ExecutingObject.Networking.Enabled = trueisInstanced = Space.Host.ExecutingObject.Networking.InstancedSpace.Host.ExecutingObject.Networking.NetworkName = "Example Network Name 1"isReady = Space.Host.ExecutingObject.Networking.Readycount = Space.Host.ExecutingObject.Networking.EventCounttableOfNames = Space.Host.ExecutingObject.Networking.EventNamestheGameObject = Space.Host.ExecutingObject.Networking.GameObjectSpace.Host.ExecutingObject.GraphicRaycaster.SortOrderPriority= 1Space.Host.ExecutingObject.GraphicRaycaster.RenderOrderPriority = 1theGameObject = Space.Host.ExecutingObject.GraphicRaycaster.GameObjectfloat BendingStiffness get set
float CollisionMassScale get set
bool EnableContinuousCollision get set
bool Enabled get set
SVector ExternalAcceleration get set
float Friction get set
SVector RandomAcceleration get set
float StretchingStiffness get set
bool UseGravity get set
SGameObject GameObject get
void OnValueChanged (Closure callback)
float Size get set
float Value get set
int NumberOfSteps get set
SColor NormalColor get set
SColor HighlightedColor get set
SColor PressedColor get set
SColor DisabledColor get set
float ColorMultiplier get set
SGameObject GameObject get
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
Space.Host.ExecutingObject.Cloth.BendingStiffness = 0.5Space.Host.ExecutingObject.Cloth.CollisionMassScale = 0.5Space.Host.ExecutingObject.Cloth.EnableContinuousCollision = trueSpace.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.8Space.Host.ExecutingObject.Cloth.RandomAcceleration = Vector.New(2,4,5)Space.Host.ExecutingObject.Cloth.StretchingStiffness = 0.6Space.Host.ExecutingObject.Cloth.UseGravity = truetheGameObject = Space.Host.ExecutingObject.Cloth.GameObjectfunction OCV()
--
end
Space.Host.ExecutingObject.UIScrollbar.OnValueChanged(OCV)Space.Host.ExecutingObject.UIScrollbar.Size = 0.1Space.Host.ExecutingObject.UIScrollbar.Value = 0.5Space.Host.ExecutingObject.UIScrollbar.NumberOfSteps = 2Space.Host.ExecutingObject.UIScrollbar.NormalColor = Color.RedSpace.Host.ExecutingObject.UIScrollbar.HighlightedColor = Color.RedSpace.Host.ExecutingObject.UIScrollbar.PressedColor = Color.RedSpace.Host.ExecutingObject.UIScrollbar.DisabledColor = Color.RedSpace.Host.ExecutingObject.UIScrollbar.ColorMultiplier = Color.RedtheGameObject = Space.Host.ExecutingObject.UIScrollbar.GameObjectSpace.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.0Space.Host.ExecutingObject.VirtualCamera.Dutch = 50.0Space.Host.ExecutingObject.VirtualCamera.NearClip = 50.0Space.Host.ExecutingObject.VirtualCamera.FarClip = 50.0Space.Host.ExecutingObject.VirtualCamera.OrthographicSize = 10.0Space.Host.ExecutingObject.VirtualCamera.Priority = 500AReferenceToGameObject = Space.Host.GetReference("Reference Name")
Space.Host.ExecutingObject.VirtualCamera.Follow = AReferenceToGameObjectAReferenceToGameObject = Space.Host.GetReference("Reference Name")
Space.Host.ExecutingObject.VirtualCamera.LookAt = AReferenceToGameObjecttheGameObject = Space.Host.ExecutingObject.VirtualCamera.GameObjectSVector get set
int get set
float get set
float get set
bool get set
bool get set
SVector Center get set
The center of the capsule, measured in the object's local space.
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)
int Direction get set
The direction of the capsule.
float Height get set
The height of the capsule measured in the object's local space.
float Radius get set
The radius of the capsule.
bool Enabled get set
Enabled Colliders will collide with other Colliders, disabled Colliders won't.
bool IsTrigger get set
Is the collider a trigger?
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
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
float Range get set
Get/Set the effective range of the light source.
float SpotAngle get set
The angle of the light's spotlight cone in degrees.
float Intensity get set
Property Description
SVector Color get set
Get/Set the color of the light.
int Type get set
Get/Set the type of light this source is. 0 = Directional, 1 = Point, 2 = Spot, 3 = Area.
SGameObject GameObject get
Property Description
void (Closure callback)
bool get set
bool get set
SColor get set
SColor get set
SColor get set
SColor get set
float get set
SGameObject get
void OnClick (Closure callback)
Invoke when a user clicks the button and releases it.
bool Enabled get set
Whether the button component is Enabled.
bool Interactable get set
Enable Interactable if you want this button to accept input.
SColor NormalColor get set
The normal color of the control.
SColor HighlightedColor get set
The color of the control when it is highlighted.
SColor PressedColor get set
The color of the control when it is pressed.
SColor DisabledColor get set
The color of the control when it is disabled.
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.
SGameObject GameObject get
Property Description
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.
bool Enabled get set
Makes the rendered 3D object visible if enabled.
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 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 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 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 get
Property Description
BoundsMin get
Property Description
void TakePhoto ()
Triggers the Photo window in the UI, with the output of this camera. Perfect for photo booths.
TakeSnapshot ()
Captures a texture from the camera, and saves it in a SResource
bool HDR get set
Can this camera write HDR values? (i.e. values brighter than 1.0)
int PixelWidth get
The width of this Camera's texture, in pixels
int PixelHeight get
The height of this Camera's texture in pixels
Velocity get
World space speed of this camera, typically used for motion blur.
bool UseOcclusionCulling get set
Is Occlusion Culling enabled on this camera?
bool Enabled get set
Is this camera enabled?
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.
bool Orthographic get set
Does this camera render without perspective?
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
float NearClip get set
How close can an object be to the camera plane before it is not rendered?
float FarClip get set
How far is an object from the camera plane before it is not rendered?
GameObject get
Returns a reference to the GameObject of this component.
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.
void ClearActions ()
Removes all actions from the clickable GameObject.
void OnClick (Closure e)
When clicked, the GameObject performs the required action.
bool Enabled get set
Enable or disable the clickable component from a GameObject.
string Tooltip get set
A hint that pops up when the mouse is hovering over the GameObject.
SGameObject GameObject get
Returns a reference to the GameObject of this component.
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.
void ForceActivate ()
Force player drive on this vehicle
void ForceDeactivate ()
Force player out of the vehicle.
void SuppressTimeout ()
Disable the vehicle automatic respawn
void OverrideOnClick (Closure onClick)
Add onClick method to this vehicle,onClick have to be a closure.
float VerticalInput get set
Force vertical offset value, it would be added to vertical control and never set to zero.
float HorizontalInput get set
Force horizontal offset value, it would be added to horizontal control and never set to zero.
float StrafeInput get set
Force strafe offset value,it would be added to strafe control and never set to zero.
float DepthInput get set
Force depth offset value, it would be added to depth control and never set to zero.
bool IgnoreUserInput get set
If this option is enabled, user input would be ignored until disable this.
Driver get
Get the player avatar component.
GameObject get
Returns the GameObject of this Vehicle component.
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.GameObjectSpace.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.GameObjectfunction 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.RedSpace.Host.ExecutingObject.UIButton.NormalColor = Color.RedSpace.Host.ExecutingObject.UIButton.PressedColor = Color.RedSpace.Host.ExecutingObject.UIButton.PressedColor = Color.RedSpace.Host.ExecutingObject.UIButton.ColorMultiplier = Color.RedSpace.Host.ExecutingObject.UIButton.GameObject = Color.Redbool 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
isVisible = Space.Host.ExecutingObject.MeshRenderer.IsVisiblevoid 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
--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.MaterialsSpace.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)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.GameObjectSpace.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.5Space.Host.ExecutingObject.Vehicle.HorizontalInput = 0.5Space.Host.ExecutingObject.Vehicle.StrafeInput = 0.5Space.Host.ExecutingObject.Vehicle.DepthInput = 0.5Space.Host.ExecutingObject.Vehicle.IgnoreUserInput = trueDriverAvatar = Space.Host.ExecutingObject.Vehicle.DriverVehicleGameObject = Space.Host.ExecutingObject.Vehicle.GameObjectfloat 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
float get set
bool get set
SLight get set
bool get set
float get set
float get set
bool get set
SColor get set
SColor get set
bool get set
float get set
float get set
bool Enabled get set
Returns true if the Audio Reactive Light Enabled.
SLight Target get set
Returns true if the light target Enabled.
bool Range get set
Returns true if Range Enabled.
float MinRange get set
Returns MinRange value of the Audio Reactive Light.
float MaxRange get set
Returns MaxRange value of the Audio Reactive Light.
bool AnimateColor get set
Returns true if AnimateColor Enabled.
SColor MinColor get set
Returns MinColor value of the Audio Reactive Light.
SColor MaxColor get set
Returns MaxColor value of the Audio Reactive Light.
bool Intensity get set
Returns true if Intensity Enabled.
float MinIntensity get set
Returns MinIntensity value of the Audio Reactive Light.
float MaxIntensity get set
Returns MaxIntensity value of the Audio Reactive Light.
SGameObject GameObject get
Returns a reference to the GameObject of this component.
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)
bool get set
SGameObject get
float GetHeight (float x, float y)
Get an interpolated height at a point x,y.
float GetSteepness (float x, float y)
Get the gradient of the terrain at point (x,y).
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].
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].
void SetHeight (int x, int y, float value)
Set value to height of [x,y]
SVector GetNormal (float x, float y)
Get an interpolated normal at a given location.
SVector GetSlope (float x, float y)
Get a normalized and interpolated normal at a given location.
SVector GetContour (float x, float y)
Get a contour of interpolated normal at a given location.
bool Enabled get set
Is the Terrain component enabled?
SGameObject GameObject get
The GameObject that this Terrain component is added to.
void (SGameObject parent, bool worldPositionStays)
void (int edge, float inset, float size)
void (bool vertical, float size)
SRect get
SVector get set
SVector get set
SVector get set
SVector get set
SVector get set
SVector get set
SVector get set
SVector get set
void SetParent (SGameObject parent, bool worldPositionStays)
Set the parent of the transform.
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.
void SetSizeWithCurrentAnchors (bool vertical, float size)
Makes the RectTransform calculated rect be a given size on the specified axis.
SRect Rect get
Property Description
SVector anchorMin get set
The normalized position in the parent RectTransform that the lower left corner is anchored to.
SVector anchorMax get set
Property Description
SVector anchoredPosition3D get set
Property Description
SVector anchoredPosition get set
Property Description
SVector sizeDelta get set
The size of this RectTransform relative to the distances between the anchors.
SVector pivot get set
The normalized position in this RectTransform that it rotates around.
SVector offsetMin get set
The offset of the lower left corner of the rectangle relative to the lower left anchor.
SVector offsetMax get set
The offset of the upper right corner of the rectangle relative to the upper right anchor.
SGameObject GameObject get
Property Description
float (int index)
void (int index, float value)
SResource get set
bool get
bool get set
SMaterial get set
SMaterial get set
SMaterial[] get set
SMaterial[] get set
SVector get
SVector get
float GetBlendShapeWeight (int index)
Return the value of BlendShapeWeight.
void SetBlendShapeWeight (int index, float value)
Set the value to the BlendShapeWeight.
SResource Mesh get set
Return the mesh.
bool IsVisible get
Property Description
bool Enabled get set
To check if the SkinnedMeshRenderer component is Enabled or not.
SMaterial Material get set
Property Description
SMaterial SharedMaterial get set
Property Description
SMaterial[] Materials get set
Property Description
SMaterial[] SharedMaterials get set
Property Description
SVector BoundsMax get
Property Description
SVector BoundsMin get
Property Description
SGameObject GameObject get
Property Description
SResource (string name)
void (string name, params DynValue[] arguments) void (string name)
void ()
object (string name)
void (string name, DynValue property, bool persistent=false)
void (string name)
SResource[] get
bool get set
string get
SGameObject get
SResource GetResource (string name)
Get the resource by its name and return it.
void CallScriptFunction (string name, params DynValue[] arguments) void CallScriptFunction (string name)
Call registered script function with specified arguments.
void Reset ()
Reset event members to their initial values.
object GetPublicVariable (string name)
Gets the public variable by its name and return it.
void SetPublicVariable (string name, DynValue property, bool persistent=false)
Set the property to public variable with name "name".
void InvokeEvent (string name)
Invokes the event with the name "name".
SResource[] Resources get
Return a list of resource.
bool Enabled get set
Whether the scripting runtime component is Enabled.
string ComponentName get
The name of this component.
SGameObject GameObject get
Property Description
void OnStateChange (Closure e)
Function Description
void Play ()
If URL is set, plays the video
void Stop ()
Stops the playback
void Pause ()
Pauses currently played video
void Resume ()
If the video is currently paused, it will resume playback
void SynchorizeUrl ()
Synchorize current video URL
void ClearRenderTexture ()
Clears the Render Texture
State get
The state player is currently in. You can track state changes through StateChangeEvent.
string URL get set
Current URL set for this Player.
AudioSource get set
Current AudioSource
OutputTexture get
Property Description
Texture get
Texture which the player uses to display the video.
double Time get set
Current player time. Can be set to move the 'playhead' to the specific position.
long Position get
Current Video Frame Position
string UniqueName get
Property Description
double VideoLength get
Get the length of the video
bool Loop get set
Whether video is set to loop or not
int FrameCount get
Returns the frame count of the video
bool IsPlaying get
Returns whether the video is playing or not
GameObject get
Property Description
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.
bool Enabled get set
Get/Set if the rendered object is visible.
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 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 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 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 get
Property Description
BoundsMin get
Property Description
GameObject get
Property Description
void NextState ()
Enter the next state
void PrevState ()
void SetState (int state) void SetState (string state)
Enters the state of being set that its order is "state"
void BindToUI () void BindToUI ( 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
bool Enabled get set
Whether the simple state machine component is Enabled or not
int StateCount get
Total number of States.
string[] StateNames get
A list of the names of all States.
int CurrentState get
The index number of the current state.
string CurrentStateName get
The name of the current state, or null if no state.
string ComponentName get
The name of this component.
GameObject get
The GameObject this component is attached to. A component is always attached to a GameObject.
Space.Host.ExecutingObject.Camera.TakePhoto()Space.Host.ExecutingObject.Camera.TakeSnapshot()Space.Host.ExecutingObject.Camera.HDR = truecameraWidthPixels = Space.Host.ExecutingObject.Camera.PixelWidthcameraHeightPixels = Space.Host.ExecutingObject.Camera.PixelHeightcameraVelocity = Space.Host.ExecutingObject.Camera.VelocitySpace.Host.ExecutingObject.Camera.UseOcclusionCulling = trueSpace.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 = 70Space.Host.ExecutingObject.Camera.Orthographic = trueSpace.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.GameObjectSpace.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.GameObjectfloatHeight = 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 = falsetheGameObject = Space.Host.ExecutingObject.Terrain.GameObjectSpace.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.RectSpace.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.GameObjectSpace.Host.ExecutingObject.SkinnedMeshRenderer.GetBlendShapeWeight(0)Space.Host.ExecutingObject.SkinnedMeshRenderer.SetBlendShapeWeight(0)Space.Host.ExecutingObject.SkinnedMeshRenderer.Mesh = Space.GetResource("resourceName")isVisible = Space.Host.ExecutingObject.SkinnedMeshRenderer.IsVisibleSpace.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").AsMaterialSpace.Host.ExecutingObject.SkinnedMeshRenderer.SharedMaterial = Space.GetResource("ResourceName").AsMaterialSpace.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.BoundsMaxvectorBoundsMin = Space.Host.ExecutingObject.SkinnedMeshRenderer.BoundsMintheGameObject = Space.Host.ExecutingObject.SkinnedMeshRenderer.GameObjectresource = 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.ResourcesSpace.Host.ExecutingObject.Script.Enabled = truecomponentName = Space.Host.ExecutingObject.Script.ComponentNametheGameObject = Space.Host.ExecutingObject.Script.GameObjectSGameObject GameObject get
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
SGameObject GameObject get
void NextState ()
void PrevState ()
bool Enabled get set
int StateCount get
string[] StateNames get
int CurrentState get
string CurrentStateName get
string ComponentName get
SGameObject GameObject get
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.
go
SGameObject
A specific SGameObject which this State Machine will bind to.
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.MaterialssharedMats = Space.Host.ExecutingObject.Renderer.SharedMaterialsvectorBoundsMax = Space.Host.ExecutingObject.Renderer.BoundsMax vectorBoundsMin = Space.Host.ExecutingObject.Renderer.BoundsMin theGameObject = Space.Host.ExecutingObject.Renderer.GameObjectSpace.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 = falsenumberOfStates = Space.Host.ExecutingObject.StateMachine.StateCounttableStateNames = Space.Host.ExecutingObject.StateMachine.StateNamescurrentState = Space.Host.ExecutingObject.StateMachine.CurrentStatecurrentStateName = Space.Host.ExecutingObject.StateMachine.CurrentStateNamecomponentName = Space.Host.ExecutingObject.StateMachine.ComponentNametheGameObject = Space.Host.ExecutingObject.StateMachine.GameObjectint 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
bool get set
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
SRigidbody ConnectedBody get set
Set joint to a rigidbody. If not set, the joint connects to the world.
SVector Axis get set
The direction of the axis around which the body swings. The direction is defined in local space.
SVector Anchor get set
The position of the axis around which the body swings. The position is defined in local space.
SVector ConnectedAnchor get set
Manual configuration of the connected anchor position.
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.
float BreakForce get set
Apply the force to break the joint.
float BreakTorque get set
Apply the torque to break the joint.
bool EnableCollision get set
When checked, this enables collisions between bodies connected with a joint.
bool EnablePreprocessing get set
Disabling preprocessing helps to stabilize impossible-to-fulfil configurations.
SVector CurrentForce get
The force applied by the solver to satisfy all constraints.
SVector CurrentTorque get
The torque applied by the solver to satisfy all constraints.
float MassScale get set
The scale to apply to the inverse mass and inertia tensor of the body
float ConnectedMassScale get set
The scale to apply to the inverse mass and inertia tensor of the connected body
SJointMotor Motor get set
The motor makes the object spin around.
SJointLimits Limits get set
The motor makes the object spin around.
SJointSpring Spring get set
The motor makes the object spin around.
bool UseMotor get set
The motor makes the object spin around.
bool UseLimits get set
If enabled, the angle of the hinge will be restricted within the Min & Max values.
bool UseSpring get set
Spring makes the Rigidbody reach for a specific angle compared to its connected body.
float Velocity get
The angular velocity of the joint in degrees per second.
float Angle get
The current angle in degrees of the joint relative to its rest position.
SGameObject GameObject get
Property Description
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
bool Enabled get set
Is this UI layout component Enabled?
int PaddingLeft get set
Space reserved for the left edge of the padding during the layout phase.
int PaddingRight get set
Space reserved for the right edge of the padding during the layout phase.
int PaddingTop get set
Space reserved for the top edge of the padding during the layout phase.
int PaddingBottom get set
Space reserved for the bottom edge of the padding during the layout phase.
string ChildAlignment get set
Property Description
float Spacing get set
The spacing to use between layout elements in the layout group.
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.
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.
bool ChildForceExpandHeight get set
Whether to force the children to expand to fill additional available vertical space.
bool ChildForceExpandWidth get set
Whether to force the children to expand to fill additional available horizontal space.
SVector GridCellSize get set
The size to use for each cell in the grid.
SVector GridSpacing get set
The spacing to use between layout elements in the grid.
int GridConstraintCount get set
How many cells there should be along the constrained axis.
string GridConstraint get set
Property Description
SGameObject GameObject get
Property Description
void (Closure callback)
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
void OnValueChanged (Closure callback)
Binds a function to be triggered when value of the UIToggle changes.
bool Enabled get set
Whether the UIToggle is Enabled
bool Interactable get set
Whether the UIToggle is Interactable
bool IsOn get set
Whether the UIToggle is toggled On
SColor NormalColor get set
The normal color.
SColor HighlightedColor get set
The color of the control when it is highlighted.
SColor PressedColor get set
The color of the control when it is pressed.
SColor DisabledColor get set
The color of the control when it is disabled.
float ColorMultiplier get set
This multiplies the tint color for each transition by its value.
SGameObject GameObject get
Property Description
Color get set
Default Color of UIImage
Sprite get set
The sprite that is used to render this image.
bool PreserveAspect get set
Whether this image should preserve its Sprite aspect ratio.
bool FillCenter get set
Whether or not to render the center
float FillAmount get set
Amount of the Image shown
bool FillClockwise get set
Whether the Image should be filled clockwise (true) or counter-clockwise (false).
int FillOrigin get set
Controls the origin point of the Fill process.
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.
bool HasBorder get
True if the sprite used has borders.
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 get set
The specified Material used by this Image. The default Material is used instead if one wasn't specified.
float MinWidth get
The minimum width this UIImage may be allocated. (Used by the Layout system).
float PreferredWidth get
The preferred width this UIImage should be allocated if there is sufficient space. (Used by the Layout system)
float FlexibleWidth get
The extra relative width this UIImage should be allocated if there is additional available space. (Used by the Layout system)
float MinHeight get
The minimum height this UIImage may be allocated.(Used by the Layout system).
float PreferredHeight get
The preferred height this UIImage should be allocated if there is sufficient space. (Used by the Layout system)
float FlexibleHeight get
The extra relative height this UIImage should be allocated if there is additional available space. (Used by the Layout system)
int LayoutPriority get
The layout priority of this UIText component.(Used by the Layout system.)
GameObject get
Property Description
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.StateCurrentURL = Space.Host.ExecutingObject.EmbeddedVideo.URLCurrentAudioSource = Space.Host.ExecutingObject.EmbeddedVideo.AudioSourceOutputTexture = Space.Host.ExecutingObject.EmbeddedVideo.OutputTexture Texture = Space.Host.ExecutingObject.EmbeddedVideo.TextureTime = Space.Host.ExecutingObject.EmbeddedVideo.TimePosition = Space.Host.ExecutingObject.EmbeddedVideo.PositionUniqueName = Space.Host.ExecutingObject.EmbeddedVideo.UniqueNameVideoLength = Space.Host.ExecutingObject.EmbeddedVideo.VideoLength Space.Host.ExecutingObject.EmbeddedVideo.Loop = trueFrameCount = Space.Host.ExecutingObject.EmbeddedVideo.FrameCountIsPlaying = Space.Host.ExecutingObject.EmbeddedVideo.IsPlayingtheGameObject = Space.Host.ExecutingObject.EmbeddedVideo.GameObjectconnectedRigidBody = Space.Host.ExecutingObject.HingeJoint.ConnectedBodySpace.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 = falseSpace.Host.ExecutingObject.HingeJoint.BreakForce = 20Space.Host.ExecutingObject.HingeJoint.BreakTorque = 1Space.Host.ExecutingObject.HingeJoint.EnableCollision = trueSpace.Host.ExecutingObject.HingeJoint.EnablePreprocessing = truevectorForce = Space.Host.ExecutingObject.HingeJoint.CurrentForcevectorTorque = Space.Host.ExecutingObject.HingeJoint.CurrentTorqueSpace.Host.ExecutingObject.HingeJoint.MassScale = 2Space.Host.ExecutingObject.HingeJoint.ConnectedMassScale = 2jointMotor = Space.Host.ExecutingObject.HingeJoint.Motor jointLimits = Space.Host.ExecutingObject.HingeJoint.LimitsjointSpring = Space.Host.ExecutingObject.HingeJoint.SpringSpace.Host.ExecutingObject.HingeJoint.UseMotor = trueSpace.Host.ExecutingObject.HingeJoint.UseLimits = trueSpace.Host.ExecutingObject.HingeJoint.UseSpring = truefloatVelocity = Space.Host.ExecutingObject.HingeJoint.VelocityfloatAngle = Space.Host.ExecutingObject.HingeJoint.AngletheGameObject = Space.Host.ExecutingObject.HingeJoint.GameObjectSpace.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= 2Space.Host.ExecutingObject.UILayout.PaddingRight= 2Space.Host.ExecutingObject.UILayout.PaddingTop= 2Space.Host.ExecutingObject.UILayout.PaddingBottom= 2Space.Host.ExecutingObject.UILayout.ChildAlignment = "1"Space.Host.ExecutingObject.UILayout.Spacing= 2Space.Host.ExecutingObject.UILayout.ChildControlHeight= trueSpace.Host.ExecutingObject.UILayout.ChildControlWidth= falseSpace.Host.ExecutingObject.UILayout.ChildForceExpandHeight= falseSpace.Host.ExecutingObject.UILayout.ChildForceExpandWidth= falseSpace.Host.ExecutingObject.UILayout.GridCellSize= Vector.New(1,1,0)Space.Host.ExecutingObject.UILayout.GridSpacing= Vector.New(1,1,0)Space.Host.ExecutingObject.UILayout.GridConstraintCount= 2Space.Host.ExecutingObject.UILayout.GridConstraint = 1theGameObject = Space.Host.ExecutingObject.UILayout.GridConstraintfunction 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.RedSpace.Host.ExecutingObject.UIToggle.HighlightedColor = Color.RedSpace.Host.ExecutingObject.UIToggle.PressedColor = Color.RedSpace.Host.ExecutingObject.UIToggle.DisabledColor = Color.RedSpace.Host.ExecutingObject.UIToggle.ColorMultiplier = 1.2theGameObject = Space.Host.ExecutingObject.UIToggle.GameObjectfloat 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
SVector GridCellSize get set
SVector GridSpacing get set
int GridConstraintCount get set
string GridConstraint get set
SGameObject GameObject get
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
float get
void (string url)
void ()
void ()
void ()
void (string name, Closure function)
void (string name, string argument)
void (Closure e)
bool get set
bool get set
bool get
bool get
bool get set
float get set
void SetURL (string url)
Sets the URL for the browser frame, and navigates to it.
url
string
A standard URL recognized by Chromium, such as https://www.youtube.com.
void Back ()
Equivalent to hitting the 'back' button within the browser.
void Forward ()
Equivalent to hitting the 'forward' button within the browser.
void Reload ()
Refreshes and reloads the current webpage.
void RegisterFunction (string name, Closure function)
Allows a JavaScript function that exists in the browser to be called by our code.
name
string
The name of the JavaScript function we want to register. The function name should start with "sinespace__".
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_".
void OnURLChanged (Closure e)
Binds a function to be called whenever the URL of the Browser Surface changes
bool Networked get set
Should changes to this browser be streamed to other clients within the area?.
bool Muted get set
Whether this Browser Surface is muted or not.
bool CanGoBack get
Returns whether this Browser Surface can navigate back
bool CanGoForward get
Returns whether this Browser Surface can navigate forward
bool EnableInput get set
Whether this Browser Surface has Input enabled or not (interactable)
float Zoom get set
Set the Zoom of the browser surface (Pixel Scaling). Positive values zoom in, negative values zoom out.
SGameObject GameObject get
Returns a reference to the GameObject of this component.
void ()
void (string url)
void (string url)
void ()
void (Closure o) void (Action< STrackInfo > trackInfoCallback)
void (Closure o) void (Action< STrackInfo > trackInfoCallback)
bool get set
string get
SGameObject get
void Play ()
Plays the radio stream
void PlayMP3Stream (string url)
Sets the given MP3 stream url as current stream
void PlayVorbisStream (string url)
Sets the given Vorbis stream url as current stream
void Stop ()
Stops playing the radio stream
void OnTrackChange (Closure o) void OnTrackChange (Action< STrackInfo > trackInfoCallback)
Function will be called when track changes.
void OnUpcomingTrackChange (Closure o) void OnUpcomingTrackChange (Action< STrackInfo > trackInfoCallback)
Function will be called when there's an upcoming track change
bool Enabled get set
Is this component Enabled?
string URL get
URL of the current stream
SGameObject GameObject get
Property Description
Space.Host.ExecutingObject.UIImage.Color= Color.RedSpace.Host.ExecutingObject.UIImage.Sprite = Space.GetResource("resource name")Space.Host.ExecutingObject.UIImage.PreserveAspect = true Space.Host.ExecutingObject.UIImage.FillCenter = trueSpace.Host.ExecutingObject.UIImage.FillAmount = 0.5Space.Host.ExecutingObject.UIImage.FillClockwise = trueSpace.Host.ExecutingObject.UIImage.FillOrigin = 0Space.Host.ExecutingObject.UIImage.AlphaHitTestMinimumThreshold = 0imgHasBorder = Space.Host.ExecutingObject.UIImage.HasBorder ppUnit = Space.Host.ExecutingObject.UIImage.PixelsPerUnitSpace.Host.ExecutingObject.UIImage.Material = Space.GetResource("resource name").AsMaterialminWidth = Space.Host.ExecutingObject.UIImage.MinWidthprefWidth = Space.Host.ExecutingObject.UIImage.PreferredWidthflexWidth = Space.Host.ExecutingObject.UIImage.FlexibleWidthminHeight = Space.Host.ExecutingObject.UIImage.MinHeightprefHeight = Space.Host.ExecutingObject.UIImage.PreferredHeightflexHeight = Space.Host.ExecutingObject.UIImage.FlexibleHeightlayoutPrio = Space.Host.ExecutingObject.UIImage.LayoutPrioritytheGameObject = Space.Host.ExecutingObject.UIImage.GameObjectSpace.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.GameObjectSpace.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.GameObjectvoid (Closure callback)
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
void OnValueChanged (Closure callback)
Callback executed when the value of the slider is changed.
bool Enabled get set
Whether this Slider component is Enabled or not
bool Interactable get set
Use to enable or disable the ability to interact with the slider.
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
float MinValue get set
The minimum allowed value of the slider.
float MaxValue get set
The maximum allowed value of the slider.
bool WholeNumbers get set
Should the value only be allowed to be whole numbers?
float Value get set
The current value of the slider.
float NormalizedValue get set
The current value of the slider normalized into a value between 0 and 1.
SColor NormalColor get set
The normal color.
SColor HighlightedColor get set
The color of the control when it is highlighted.
SColor PressedColor get set
The color of the control when it is pressed.
SColor DisabledColor get set
The color of the control when it is disabled.
float ColorMultiplier get set
This multiplies the tint color for each transition by its value.
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)
bool get set
bool get set
bool get set
bool get set
bool get set
int get
string get
bool get
bool get
void SetOverrideVoice (bool enabled)
Set voice to override the original voice.
void ClearOverrideVoice ()
Clear the overriding voice.
void SetOverrideVideo (bool enabled)
Function Description
void ClearOverrideVideo ()
Function Description
void AddAuthVoiceUser (uint userID)
Add a user to AuthVoiceUser by his ID.
void RemoveAuthVoiceUser (uint userID)
Remove a user from AuthVoiceUser by his ID.
void AddAuthVideoUser (uint userID)
Function Description
void RemoveAuthVideoUser (uint userID)
Remove a user from AuthVoiceUser by his ID.
bool Enabled get set
Whether the Voice Zone component is Enabled
bool AllowVoice get set
Whether allows voice.
bool AllowVideo get set
Whether allows video.
bool ConnectVoiceService get set
Property Description
bool ConnectVideoService get set
Property Description
int Priority get
The priority of the voice zone
string AreaName get
The name of area.
bool Spatialized get
Whether the voice zone is spatialized.
bool SpatialDropoff get
Whether the voice zone is spatialized drop off.
bool SpatialStereo get
Whether the voice zone is spatial stereo.
float SpatialDistance get
The spatial distance of the voice zone.
bool Global get
Whether the voice zone is global.
uint[] AuthVideoUsers get
Return an array of auth video user.
uint[] AuthVoiceUsers get
Property Description
SGameObject GameObject get
Property Description
ClosestPointOnBounds ( position)
The closest point to the bounding box of the attached collider. This can be used to calculate hit points when applying explosion damage.
ClosestPoint ( position)
The point on the collider that is closest to the specified location.
bool SimpleMove ( 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.
int Move ( motion)
Supplies the movement of a with an attached SCharacterController component.
The SCharacterController.Move motion moves the 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.
Center get set
Returns Center Vector value of the Character Controller.
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.
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.
float Height get set
The height of the character's capsule.
float MinMoveDistance get set
Gets or sets the minimum move distance of the character controller.
float Radius get set
The radius of the character's capsule.
float SkinWidth get set
The character's collision skin width.
float SlopeLimit get set
The character controllers slope limit in degrees.
float StepOffset get set
The character controllers step offset in meters.
Velocity get
The current relative velocity of the Character.
GameObject get
Returns a reference to the GameObject of this component.
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 = 1Space.Host.ExecutingObject.UISlider.MinValue = 10Space.Host.ExecutingObject.UISlider.MaxValue = 20Space.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 = 20Space.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.RedSpace.Host.ExecutingObject.UISlider.HighlightedColor = Color.RedSpace.Host.ExecutingObject.UISlider.PressedColor = Color.RedlSpace.Host.ExecutingObject.UISlider.DisabledColor = Color.RedSpace.Host.ExecutingObject.UISlider.ColorMultiplier = 1.2theGameObject = Space.Host.ExecutingObject.UISlider.GameObjectSpace.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 = trueSpace.Host.ExecutingObject.VoiceZone.AllowVideo = trueSpace.Host.ExecutingObject.VoiceZone.ConnectVoiceService = trueSpace.Host.ExecutingObject.VoiceZone.ConnectVideoService = truepriority = Space.Host.ExecutingObject.VoiceZone.Prioritypriority = Space.Host.ExecutingObject.VoiceZone.AreaNameisSpatialized = Space.Host.ExecutingObject.VoiceZone.SpatializedspatialDropoff = Space.Host.ExecutingObject.VoiceZone.SpatialDropoffspatialStereo = Space.Host.ExecutingObject.VoiceZone.SpatialStereofloatDistance = Space.Host.ExecutingObject.VoiceZone.SpatialDistanceisGlobal = Space.Host.ExecutingObject.VoiceZone.GlobaltableAuthVideoUsers = Space.Host.ExecutingObject.VoiceZone.AuthVideoUserstableAuthVideoUsers = Space.Host.ExecutingObject.VoiceZone.AuthVoiceUserstheGameObject = Space.Host.ExecutingObject.VoiceZone.GameObjectSColor HighlightedColor get set
SColor PressedColor get set
SColor DisabledColor get set
float ColorMultiplier get set
SGameObject GameObject get
bool SpatialStereo get
float SpatialDistance get
bool Global get
uint[] AuthVideoUsers get
uint[] AuthVoiceUsers get
SGameObject GameObject get
void ()
void (string[] options) void (Table options) void (SResource[] optionsSprites)
void ()
void ()
void ()
void (Closure callback)
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
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.
void AddOptions (string[] options) void AddOptions (Table options) void AddOptions (SResource[] optionsSprites)
Add multiple options to the options of the Dropdown.
void ClearOptions ()
Clear the list of options in the Dropdown.
void Show ()
Show the dropdown list.
void Hide ()
Hide the dropdown list.
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.
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.
bool Interactable get set
Is this UIDropdown interactable?
SGameObject Template get set
The Rect Transform of the template for the dropdown list.
SUIText CaptionText get set
The Text component to hold the text of the currently selected option.
SUIImage CaptionImage get set
The Image component to hold the image of the currently selected option.
SUIText ItemText get set
The Text component to hold the text of the item.
SUIImage ItemImage get set
The Image component to hold the image of the item.
string[] OptionsAsText get
The list of possible options. (Text)
SResource[] OptionsAsSprites get
The list of possible options. (Sprites)
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.
SColor NormalColor get set
Property Description
SColor HighlightedColor get set
Property Description
SColor PressedColor get set
Property Description
SColor DisabledColor get set
Property Description
float ColorMultiplier get set
Property Description
SGameObject GameObject get
Property Description
SVector ClosestPointOnBounds (SVector position)
SVector ClosestPoint (SVector position)
bool SimpleMove (SVector speed)
int Move (SVector motion)
SVector Center get set
bool DetectCollisions get set
bool EnableOverlapRecovery get set
float Height get set
float MinMoveDistance get set
float Radius get set
float SkinWidth get set
float SlopeLimit get set
float StepOffset get set
SVector get
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 = aReferenceToAGameObjectcaptionText = Space.Host.ExecutingObject.UIDropdown.CaptionText
captionText.Text = "new caption"aReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UIImageaReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UITextiaReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UIImageoptionsText = Space.Host.ExecutingObject.UIDropdown.OptionsAsTextoptionsSprites = Space.Host.ExecutingObject.UIDropdown.OptionsAsSpritesSpace.Host.ExecutingObject.UIDropdown.Value= 2Space.Host.ExecutingObject.UIDropdown.NormalColor = Color.RedSpace.Host.ExecutingObject.UIDropdown.HighlightedColor = Color.RedSpace.Host.ExecutingObject.UIDropdown.PressedColor = Color.RedSpace.Host.ExecutingObject.UIDropdown.DisabledColor = Color.RedSpace.Host.ExecutingObject.UIDropdown.ColorMultiplier = Color.RedSpace.Host.ExecutingObject.UIDropdown.GameObject = Color.RedclosestPoint = 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.VelocitytheGameObject = Space.Host.ExecutingObject.CharacterController.GameObjectSColor NormalColor get set
SColor HighlightedColor get set
SColor PressedColor get set
SColor DisabledColor get set
float ColorMultiplier get set
SGameObject GameObject get
void ()
void ()
void (Closure e)
void (Closure e)
void (Closure e)
void (Closure e)
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
void SitPlayer ()
Make a player sit.
void UnseatPlayer ()
Make a player unseat.
void OnStandUp (Closure e)
Binds a function to the Seat's On Stand Up event
void OnSit (Closure e)
Binds a function to the Seat's On Sit event
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
void OnPlayerSit (Closure e)
Binds a function to the Seat's On Player Sit event which is fired only on the Player's client
bool Enabled get set
Whether the seat component is enabled.
bool InUse get
Return that whether the seat is in use.
long PlayerSeated get
Return the ID of the seating player.
bool UseSlotID get set
Return true if uses SlotID
string SlotID get set
Return the slot ID of the seat.
SCollider ClickableCollider get set
Return the clickable collider.
SResource Animation get set
Return the animation clip.
SResource AnimationMale get set
No Description
SResource AnimationFemale get set
No Description
SGameObject GameObject get
Property Description
bool SupportRichText get set
Whether this Text will support rich text.
bool ResizeTextForBestFit get set
Should the text be allowed to auto resized.
int ResizeTextMinSize get set
The minimum size the text is allowed to be.
int ResizeTextMaxSize get set
The maximum size the text is allowed to be.
bool AlignByGeometry get set
Use the range of glyph geometry to perform horizontal alignment.
int FontSize get set
The size that the Font should render at.
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.
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.
float MinWidth get
The minimum width this UIText may be allocated. (Used by the Layout system).
float PreferredWidth get
The preferred width this UIText should be allocated if there is sufficient space. (Used by the Layout system)
float FlexibleWidth get
The extra relative width this UIText should be allocated if there is additional available space. (Used by the Layout system)
float MinHeight get
The minimum height this UIText may be allocated.(Used by the Layout system).
float PreferredHeight get
The preferred height this UIText should be allocated if there is sufficient space. (Used by the Layout system)
float FlexibleHeight get
The extra relative height this UIText should be allocated if there is additional available space. (Used by the Layout system.)
int LayoutPriority get
The layout priority of this UIText component.(Used by the Layout system.)
bool Enabled get set
Whether the UIText component is Enabled or not will decide if it is visually updating or not.
string Text get set
The string value this Text displays.
Color get set
Base color of the Graphic.
GameObject get
Property Description
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.PlayerSeatedSpace.Host.ExecutingObject.Seat.UseSlotID = falseseatSlotID = Space.Host.ExecutingObject.Seat.SlotIDseatClickableCollider = Space.Host.ExecutingObject.Seat.ClickableColliderSpace.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.GameObjectSGameObject GameObject get
float get
float get
int get
bool get set
string get set
SColor get set
SGameObject get
bool SupportRichText get set
bool ResizeTextForBestFit get set
int ResizeTextMinSize get set
int ResizeTextMaxSize get set
bool AlignByGeometry get set
int FontSize get set
float LineSpacing get set
float PixelsPerUnit get
float MinWidth get
float PreferredWidth get
float FlexibleWidth get
float get
void ()
void ()
void ()
void ()
void (SResource clip, float volume)
void (SResource clip, SVector position, float volume=1f)
bool get set
bool get set
float get set
float get set
float get set
float get set
int get set
float get
int get
void Play ()
Starts playing the audio clip.
void Stop ()
Stops playing the audio clip.
void Pause ()
Pauses the audio clip.
void UnPause ()
Pauses the audio clip.
void PlayOneShot (SResource clip, float volume)
Plays the audio clip just ones at a desired volume.
Function Description
bool Enabled get set
Is the Audio Source component enabled?
bool Loop get set
Is looping of the sound clip enabled?
float DopplerLevel get set
The Doppler level of the Audio Source. (See: Doppler Effect)
float Volume get set
The Volume level of the Audio Source.
float Pitch get set
The Pitch level for the Audio Source.
float Time get set
Playback position in seconds.
int TimeSamples get set
Playback position in PCM samples.
float Length get
Return Audio Length.
int Samples get
Return Audio Samples.
bool IsPlaying get
Is the sound clip playing right now?
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.
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).
bool Spatialize get set
Is spatialization enabled?
bool SpatializePostEffects get set
Is spatialization enabled before or after other filters are in action?
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).
bool BypassEffects get set
When true, none of global sound effects (reverbs, filters, etc.) are applied to the audio from this Audio Source.
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.
bool BypassReverbZones get set
When true, the audio from this Audio Source is not mixed into the global reverb generated through Reverb Zones.
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".
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.
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.
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.)
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.)
SResource AudioClip get set
The audio clip that is or will be played by this Audio Source.
SGameObject GameObject get
Returns a reference to the GameObject of this component.
float GetAreaCost (int areaIndex)
Function Description
void Move ( movement)
Apply relative movement to current position.
void Resume ()
Resume the NavMesh agent.
void SetAreaCost (int areaIndex, float cost)
Sets the cost for traversing over areas of the area type.
void Stop ()
To stop the NavMesh agent.
void SetDestination ( position)
Set or update the destination.
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).
bool Enabled get set
Enable or disable this component.
float Accelleration get set
The maximum acceleration of an agent as it follows a path.
float AngularSpeed get set
Maximum turning speed in while following a path.
int AreaMask get set
Specifies which NavMesh area is passable.
bool AutoRepath get set
Set the agent attempt to acquire a new path if the existing path becomes invalid.
bool AutoBraking get set
Set the agent brake automatically to avoid overshooting the destination point.
bool AutoTraverseOffMeshLink get set
Set the agent move across OffMeshLinks automatically.
int AvoidancePriority get set
The avoidance priority level.
float BaseOffset get set
The relative vertical displacement of the GameObject.
DesiredVelocity get
The desired velocity of the agent including any potential contribution from avoidance.
Destination get set
The desired velocity of the agent including any potential contribution from avoidance.
bool HasPath get
Does the agent currently have a path?
float Height get set
The height of the agent for purposes of passing under obstacles, etc.
bool IsOnNavMesh get
Is the agent currently bound to the navmesh?
bool IsOnOffMeshLink get
Is the agent currently positioned on an OffMeshLink?
bool IsPathStale get
Is the current path stale?
NextPosition get set
Get or set the simulation position of the navmesh agent.
PathEndPosition get
End positon of navigation.
bool PathPending get
Is a path in the process of being computed but not yet ready?
float Radius get set
The avoidance radius for the agent.
float RemainingDistance get
The distance between the agent's position and the destination on the current path.
float Speed get set
Maximum movement speed when following a path.
SteeringTarget get
Get the current steering target along the path.
float StoppingDistance get set
Stop within this distance from the target position.
bool UpdatePosition get set
Get or set whether the transform position is synchronized with the simulated agent position.
bool UpdateRotation get set
Should the agent update the transform orientation?
Velocity get
access the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually.
GameObject get
Property Description
void OnValueChanged (Closure callback)
Given function will be called when text in Input Field has changed
void OnEndEdit (Closure callback)
Given function will be called when editing has ended
void ActivateInputField ()
Function Description
void DeactivateInputField ()
Function Description
void Select ()
Function Description
string Text get set
The current value of the input field.
bool Enabled get set
Whether this Input Field component is Enabled
bool Interactable get set
Is the Input Field interactable?
bool IsFocused get
Does the InputField currently have focus and is able to process events.
float CaretBlinkRate get set
The blinking rate of the input caret, defined as the number of times the blink cycle occurs per second.
int CaretWidth get set
The width of the caret in pixels.
int CharacterLimit get set
Property Description
bool ReadOnly get set
Property Description
bool MultiLine get
If the input field supports multiple lines.
char AsteriskChar get set
The character used for password fields.
int CaretPosition get set
Current InputField caret position (also selection tail).
int SelectionAnchorPosition get set
The beginning point of the selection.
int SelectionFocusPosition get set
The end point of the selection.
float MinWidth get
The minimum width this UIInputField may be allocated. (Used by the Layout system).
float PreferredWidth get
The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)
float FlexibleWidth get
The extra relative width this UIInputField should be allocated if there is additional available space. (Used by the Layout system)
float MinHeight get
The minimum height this UIInputField may be allocated.(Used by the Layout system).
float PreferredHeight get
The preferred height this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)
float FlexibleHeight get
The extra relative height this UIInputField should be allocated if there is additional available space. (Used by the Layout system)
SColor NormalColor get set
The normal color.
HighlightedColor get set
The color of the control when it is highlighted.
PressedColor get set
The color of the control when it is pressed.
DisabledColor get set
The color of the control when it is disabled.
float ColorMultiplier get set
This multiplies the tint color for each transition by its value.
GameObject get
Property Description
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 consolethisObject = 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 consolepWidth = Space.Host.ExecutingObject.UIText.PreferredWidthFlexibleWidth = Space.Host.ExecutingObject.UIText.FlexibleWidth minHeight = Space.Host.ExecutingObject.UIText.MinHeightpHeight = Space.Host.ExecutingObject.UIText.PreferredHeightFlexibleHeight = Space.Host.ExecutingObject.UIText.FlexibleHeightlayoutPriority = 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.TextSpace.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/unpausedSpace.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/unpausedSpace.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 = falsehostObject = 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.5hostObject = 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.5hostObject = 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 = 1hostObject = 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 = trueexa--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.0hostObject = 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 = 50hostObject = 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 = truehostObject = 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.GameObjectbool IsPlaying get
float PanStereo get set
float SpatialBlend get set
bool Spatialize get set
bool SpatializePostEffects get set
float ReverbZoneMix get set
bool BypassEffects get set
bool BypassListenerEffects get set
bool BypassReverbZones get set
float Spread get set
int Priority get set
bool Mute get set
float MinDistance get set
float MaxDistance get set
SResource AudioClip get set
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 get
int get set
int get set
int get set
float get
float get
float get
float get
float get
float get
SColor get set
SColor get set
SColor get set
SColor get set
float get set
SGameObject get
void OnValueChanged (Closure callback)
void OnEndEdit (Closure callback)
void ActivateInputField ()
void DeactivateInputField ()
void Select ()
string Text get set
bool Enabled get set
bool Interactable get set
bool IsFocused get
float CaretBlinkRate get set
int CaretWidth get set
int CharacterLimit get set
bool ReadOnly get set
bool MultiLine get
char get set
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 = 60Space.Host.ExecutingObject.NavMeshAgent.AngularSpeed = 60Space.Host.ExecutingObject.NavMeshAgent.AreaMask = 3Space.Host.ExecutingObject.NavMeshAgent.AutoRepath = falseSpace.Host.ExecutingObject.NavMeshAgent.AutoBraking = falseSpace.Host.ExecutingObject.NavMeshAgent.AutoTraverseOffMeshLink = falseSpace.Host.ExecutingObject.NavMeshAgent.AvoidancePriority = 10Space.Host.ExecutingObject.NavMeshAgent.BaseOffset = 3vectorVelocity = Space.Host.ExecutingObject.NavMeshAgent.DesiredVelocitySpace.Host.ExecutingObject.NavMeshAgent.Destination = Vector.New(10,0,0)hasPath = Space.Host.ExecutingObject.NavMeshAgent.HasPathSpace.Host.ExecutingObject.NavMeshAgent.Height = 5isOn = Space.Host.ExecutingObject.NavMeshAgent.IsOnNavMeshisOnOff = Space.Host.ExecutingObject.NavMeshAgent.IsOnOffMeshLinkisStale = Space.Host.ExecutingObject.NavMeshAgent.IsPathStaleSpace.Host.ExecutingObject.NavMeshAgent.NextPosition = Vector.New(10, 0, 0)vectorPathEndPos = Space.Host.ExecutingObject.NavMeshAgent.PathEndPositionisPending = Space.Host.ExecutingObject.NavMeshAgent.PathPendingSpace.Host.ExecutingObject.NavMeshAgent.Radius = 5vectorDist = Space.Host.ExecutingObject.NavMeshAgent.RemainingDistanceSpace.Host.ExecutingObject.NavMeshAgent.Speed = 20vectorSteeringTarget = Space.Host.ExecutingObject.NavMeshAgent.SteeringTargetSpace.Host.ExecutingObject.NavMeshAgent.StoppingDistance = 2Space.Host.ExecutingObject.NavMeshAgent.UpdatePosition = trueSpace.Host.ExecutingObject.NavMeshAgent.UpdateRotation = truevectorVelocity = Space.Host.ExecutingObject.NavMeshAgent.VelocitytheGameObject = Space.Host.ExecutingObject.NavMeshAgent.GameObjectfunction 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= 3Space.Host.ExecutingObject.UIInputField.CaretWidth= 4Space.Host.ExecutingObject.UIInputField.CharacterLimit= 8Is 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 = trueSpace.Host.ExecutingObject.UIInputField.AsteriskChar= "%"Space.Host.ExecutingObject.UIInputField.CaretPosition= 3Space.Host.ExecutingObject.UIInputField.SelectionAnchorPosition= 1Space.Host.ExecutingObject.UIInputField.SelectionFocusPosition= 4minWidth = Space.Host.ExecutingObject.UIInputField.MinWidthprefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidthflexWidth = Space.Host.ExecutingObject.UIInputField.FlexibleWidthminHeight = Space.Host.ExecutingObject.UIInputField.MinHeightprefHeight = Space.Host.ExecutingObject.UIInputField.PreferredHeightflexHeight = Space.Host.ExecutingObject.UIInputField.FlexibleHeightSpace.Host.ExecutingObject.UIInputField.NormalColor = Color.RedSpace.Host.ExecutingObject.UIInputField.HighlightedColor = Color.RedSpace.Host.ExecutingObject.UIInputField.PressedColor = Color.RedSpace.Host.ExecutingObject.UIInputField.DisabledColor = Color.RedSpace.Host.ExecutingObject.UIInputField.ColorMultiplier = Color.RedtheGameObject = Space.Host.ExecutingObject.UIInputField.GameObjectvoid 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.
void Stop (bool withChildren) void Stop ()
Stops playing the Particle System. Parameter withChildren: Plays all child Particle Systems as well.
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.
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.
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.
void Emit (int count)
Emit 'count' particles immediately.
void Simulate (float time)
Fast-forwards the Particle System by simulating particles over 'time' seconds, then pauses it.
void SetTriggerParticles (int type, [] 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
[] 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.
float StartDelay get set
Start delay in seconds. Use this to delay when playback starts on the system.
bool IsPlaying get
Determines whether the Particle System is playing.
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.
bool IsStopped get
Determines whether the Particle System is stopped.
bool IsPaused get
Determines whether the Particle System is paused.
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.
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.
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).
GameObject get
Property Description
bool 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 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 get set
Playback position in seconds. Use this to read current playback time or to seek to a new playback time.
float get
The duration of the Particle System in seconds.
float get set
The playback speed of the Particle System. 1 is normal playback speed.
int get
The current number of particles.
bool get set
When set to false, the Particle System will not emit particles.
float get set
The rate of particle emission.
float get set
The rate at which the emitter spawns new particles over time.
float get set
The rate at which the emitter spawns new particles over distance. The emitter only spawns new particles when it moves.
float get set
The initial speed of particles when the Particle System first spawns them.
float get set
The initial size of particles when the Particle System first spawns them.
SColor get set
The initial color of particles when the Particle System first spawns them.
float 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 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 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 get set
A scale that this Particle System applies to gravity.
int get set
The maximum number of particles to emit.
uint get set
Override the random seed used for the Particle System emission.
bool 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 get
bool IsAlive (bool withChildren)
void Emit (int count)
void Simulate (float time)
void SetTriggerParticles (SParticleSystemTriggerEventType type, SParticle[] sp)
SParticle[] GetTriggerParticles (SParticleSystemTriggerEventType type)
float StartDelay get set
Start delay in seconds. Use this to delay when playback starts on the system.
bool IsPlaying get
Determines whether the Particle System is playing.
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.
bool IsStopped get
Determines whether the Particle System is stopped.
bool IsPaused get
Determines whether the Particle System is paused.
type
int
Type of trigger to return particles for. 1 = Inside 2 = Outside 3 = Enter 4 = Exit
sp
A table of SParticle
type
int
Type of trigger to return particles for. 1 = Inside 2 = Outside 3 = Enter 4 = Exit
void Clear ()
Function Description
GetPosition (int index)
Get the position of a vertex in the trail.
bool Enabled get set
Whether this TrailRenderer component is Enabled.
bool ReceiveShadows get set
Does this object receive shadows?
bool IsVisible get
Is this renderer visible in any camera?
bool CastShadows get set
Does the trail cast a shadow when a shadow-casting Light shines on it?
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.
bool UseLightProbes get set
Enable Light Probes on the trail.
float Time get set
How long does the trail take to fade out. (seconds)
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.
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.
float WidthMultiplier get set
Set an overall multiplier that is applied to the TrailRenderer.widthCurve to get the final width of the trail.
StartColor get set
Set the color at the start of the trail.
EndColor get set
Set the color at the end of the trail.
bool Autodestruct get set
Does the GameObject of this Trail Renderer auto destruct?
int NumCornerVertices get set
Set this to a value greater than 0, to get rounded corners between each segment of the trail.
int NumCapVertices get set
Set this to a value greater than 0, to get rounded corners on each end of the trail.
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.
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
int Alignment get set
Property Description
int PositionCount get
Get the number of line segments in the trail.
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 = 5isPlaying = Space.Host.ExecutingObject.ParticleSystem.IsPlayingisEmitting = Space.Host.ExecutingObject.ParticleSystem.IsEmittingisStopped = Space.Host.ExecutingObject.ParticleSystem.IsStoppedisPaused = Space.Host.ExecutingObject.ParticleSystem.IsPausedSpace.Host.ExecutingObject.ParticleSystem.Loop = trueSpace.Host.ExecutingObject.ParticleSystem.PlayOnAwakeSpace.Host.ExecutingObject.ParticleSystem.Time = 5.0duration = Space.Host.ExecutingObject.ParticleSystem.DurationSpace.Host.ExecutingObject.ParticleSystem.PlaybackSpeed = 1.5count = Space.Host.ExecutingObject.ParticleSystem.ParticleCountSpace.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 = 123456Space.Host.ExecutingObject.ParticleSystem.UseAutoRandomSeed = true theGameObject = Space.Host.ExecutingObject.ParticleSystem.GameObjectSColor 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
float get set
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.PositionCounttheGameObject = Space.Host.ExecutingObject.TrailRenderer.GameObjectvoid ()
void ()
void (double time)
double ()
double (int layer=0)
double (int layer=0)
bool (int layer=0)
float (string name)
float (int id)
bool (string name)
bool (int id)
int (string name)
int (int id)
void (string name)
void (int id)
SResource get set
SResource get set
bool get set
float get set
bool get set
string[] get
void Rebind ()
Rebind all the animated properties and mesh data with the Animator.
void Stop ()
Stop the Animator.
void SetTime (double time)
Function Description
double GetTime ()
Function Description
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.
double GetLength (int layer=0)
Current duration of the state.
bool GetLoop (int layer=0)
Is the state looping.
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.
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.
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.
void ResetTrigger (string name) void ResetTrigger (int id)
Resets the trigger parameter to false.
bool IsParameterControlledByCurve (string name)
bool IsParameterControlledByCurve (int id)
Returns true if a parameter is controlled by an additional curve on an animation.
string GetLayerName (int layerIndex)
Gets name of the layer.
int GetLayerIndex (string layerName)
Gets the index of the layer with specified name.
float GetLayerWeight (int layerIndex)
Gets the layer's current weight.
void SetLayerWeight (int layerIndex, float weight)
Sets the weight of the layer at the given index.
bool IsInTransition (int layerIndex)
Is the specified layer in a transition.
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.
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.
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.
void Play (string stateName)
void Play (string stateName, int layer)
void Play (string stateName, int layer, float normalizedTime)
Plays a state.
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.
void StartPlayback ()
Sets the animator in playback mode.
void StopPlayback ()
Stops the animator playback mode. When playback stops, the avatar resumes getting control from game logic.
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
void StopRecording ()
Stops animator record mode.
void Update (float deltaTime)
Function Description
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.
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.
void SetBool (int id, bool value) void SetBool (string name, bool value)
Sets the value of a boolean parameter.
void SetInteger (string name, int value) void SetInteger (int id, int value)
Sets the value of the given integer parameter.
int StringToHash (string name)
Generates an parameter id from a string. Ids are used for optimized setters and getters on parameters.
SAnimatorStateInfo GetCurrentAnimatorStateInfo (int Layerindex)
Returns an SAnimatorStateInfo with the information on the current state..
SResource Controller get set
The Animator Controller resource of this Animator
SResource Avatar get set
Gets/Sets the current Avatar.
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.
float PlaybackTime get set
Property Description
bool Enabled get set
Whether the Animator component is enabled or not
string[] Parameters get
The AnimatorControllerParameter list used by the animator.
SGameObject GameObject get
Returns a reference to the GameObject of this component.
void (int index, SVector position)
SVector (int index)
void (SVector[] positions)
SVector[] ()
void (float start, float end)
void (SColor start, SColor end)
bool get set
bool get set
bool get
bool get set
bool get set
bool get set
float get set
float get set
float get set
void SetPosition (int index, SVector position)
Set the position of a vertex in the line.
SVector GetPosition (int index)
Get the position of a vertex in the line
void SetPositions (SVector[] positions)
Set the positions of all vertices in the line.
SVector[] GetPositions ()
Get the positions of all vertices in the line.
void SetWidth (float start, float end)
Set width at start and end
Set color at start and end (Line shader necessary)
bool Enabled get set
Makes the renderer visible if enabled.
bool ReceiveShadows get set
Enable this option to make the line display any shadows that are cast upon it.
bool IsVisible get
To check if this renderer is visible.
bool CastShadows get set
Specify if and how the line casts shadows when a suitable Light shine on it.
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
bool UseLightProbes get set
The light probe interpolation type.
float StartWidth get set
Set the width at the start of the line.
float EndWidth get set
Set the width at the end of the line.
float WidthMultiplier get set
Set an overall multiplier that is applied to the LineRenderer.widthCurve to get the final width of the line.
SColor StartColor get set
Set the color at the start of the line.
SColor EndColor get set
Set the color at the end of the line.
int PositionCount get set
Set/get the number of vertices.
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.
bool Loop get set
Enable this to connect the first and last positions of the line, and form a closed loop.
int NumCornerVertices get set
Set this to a value greater than 0, to get rounded corners between each segment of the line.
int NumCapVertices get set
Set this to a value greater than 0, to get rounded corners on each end of the line.
int TextureMode get set
Control how the Texture is applied to the line. (0-3)
int Alignment get set
Set the direction that the line faces. (0 or 1)
SGameObject GameObject get
Property Description
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 ()
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
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.
void AddForce (SVector force)
Adds a force to the Rigidbody that is continuously exerted on it in the given direction.
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.
void AddRelativeTorque (SVector torque)
Adds a torque to the rigidbody relative to the local coordinate system.
void AddTorque (SVector torque)
Adds a torque to the rigidbody relative to the global coordinate system.
Returns the closest point on the bounding box of the attached colliders.
Function Description
Function Description
void MovePosition (SVector point)
Moves the rigidbody to position.
void MoveRotation (SQuaternion rotation)
Rotates the rigidbody to rotation.
void ResetCenterOfMass ()
Reset the center of mass of the rigidbody.
void ResetIntertiaTensor ()
Reset the inertia tensor value and rotation.
void Sleep ()
Forces a rigidbody to sleep.
void WakeUp ()
Forces a rigidbody to wake up.
SPhysicsHit[] SweepTestAll (SVector direction, float distance)
Like Rigidbody.SweepTest, but returns all hits.
float AngularDrag get set
The angular drag of the object.
SVector AngularVelocity get set
The angular velocity vector of the rigidbody (in radians per second).
SVector CenterOfMass get set
The center of mass relative to the local origin.
float Drag get set
The drag of the object.
bool FreezeRotation get set
Controls whether physics will have any impact on the rotation of the object.
bool Kinematic get set
Controls whether physics will have any impact on the object.
float Mass get set
The mass of the rigidbody.
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.
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.
bool UseGravity get set
Controls whether gravity affects the rigidbody.
SVector Velocity get set
The velocity vector of the rigidbody. (in units per second).
SVector WorldCenterOfMass get
The center of mass of the rigidbody relative to the global origin (Read Only).
bool Sleeping get
Is the rigidbody sleeping?
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).
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.
SQuaternion InertiaTensorRotation get set
The rotation of the inertia tensor.
SGameObject GameObject get
Property Description
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.5Space.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 parameterstheGameObject = Space.Host.ExecutingObject.Animator.GameObjectSpace.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.IsVisibleSpace.Host.ExecutingObject.LineRenderer.CastShadows = trueSpace.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.GameObjectSpace.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 axisSpace.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 axisSpace.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 originSpace.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 directionSpace.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 ZSpace.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 consoleSpace.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 setSpace.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.20Space.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 consoleSpace.Host.ExecutingObject.Rigidbody.CenterOfMass = Vector.New(1,0,0)Space.Host.ExecutingObject.Rigidbody.Drag = 5Space.Host.ExecutingObject.Rigidbody.FreezeRotation = trueSpace.Host.ExecutingObject.Rigidbody.Kinematic = trueSpace.Host.ExecutingObject.Rigidbody.Mass = 0.1Space.Host.ExecutingObject.Rigidbody.MaxAngularVelocity = 1Space.Host.ExecutingObject.Rigidbody.MaxDepenetrationVelocity = 1Space.Host.ExecutingObject.Rigidbody.UseGravity = truelocal 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 consoleSpace.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 consoleWorldCenter = Space.Host.ExecutingObject.Rigidbody.WorldCenterOfMasslocal 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.Sleepinglocal 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 consoledensity = Space.Host.ExecutingObject.Rigidbody.Densitylocal 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.GameObjectbool IsParameterControlledByCurve (string name)
bool IsParameterControlledByCurve (int id)
string GetLayerName (int layerIndex)
int GetLayerIndex (string layerName)
float GetLayerWeight (int layerIndex)
void SetLayerWeight (int layerIndex, float weight)
bool IsInTransition (int layerIndex)
void CrossFadeInFixedTime (string stateName, float transitionDuration, int layer)
void CrossFadeInFixedTime (string stateName, float transitionDuration)
void CrossFadeInFixedTime (string stateName, float transitionDuration, int layer, float fixedTime)
void PlayInFixedTime (string stateName, int layer)
void PlayInFixedTime (string stateName)
void PlayInFixedTime (string stateName, int layer, float fixedTime)
void StartPlayback ()
void StopPlayback ()
void StartRecording ()
void StopRecording ()
void Update (float deltaTime)
void SetTrigger (string trigger)
void SetTrigger (int id)
void SetInteger (string name, int value)
void SetInteger (int id, int value)
int StringToHash (string name)
SAnimatorStateInfo GetCurrentAnimatorStateInfo (int Layerindex)
SColor StartColor get set
SColor EndColor get set
int PositionCount get set
bool UseWorldSpace get set
bool Loop get set
int NumCornerVertices get set
int NumCapVertices get set
int TextureMode get set
int Alignment get set
SGameObject GameObject get
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