LogoLogo
Scripting DocsSupport
Scripting
Scripting
  • Sinespace Scripting Documentation
  • Client Scripting
    • Viewer
      • SDialogues
      • SInput
      • SShared
      • SUI
    • Network
      • SChat
      • SNetwork
      • SPhotos
      • SVideos
      • SWebService
    • Player
      • SEconomy
      • SGroup
      • SInventory
      • SProfile
      • SQuests
    • Region
      • SCameraManager
      • SGrid
      • SHost
      • SPersistence
      • SPhysics
      • SPostFX
      • SScene
      • SScript
      • SRenderSettings
    • Components
      • SAnimation
      • SAnimator
      • SAudioReactiveAnimation
      • SAudioReactiveBase
      • SAudioReactiveLight
      • SAudioReactiveMaterial
      • SAudioReactiveParticleSystem
      • SAudioReactiveTransform
      • SAudioSource
      • SBoxCollider
      • SBrowserSurface
      • SCamera
      • SCanvasGroup
      • SCapsuleCollider
      • SCharacterController
      • SClickable
      • SCloth
      • SCollider
      • SContentSizeFitter
      • SEmbeddedVideo
      • SEventCalendar
      • SFurniture
      • SGraphicRaycaster
      • SHingeJoint
      • SLight
      • SLineRenderer
      • SMeshRenderer
      • SModularVehicle
      • SNavMeshAgent
      • SNavMeshObstacle
      • SNetworking
      • SParticleSystem
      • SPlayableDirector
      • SPostProcessVolume
      • SRectTransform
      • SReflectionProbe
      • SRenderer
      • SRigidbody
      • SRoomFloor
      • SSceneBackgroundMusic
      • SScriptingData
      • SScriptingEvents
      • SScriptingResources
      • SScriptingRuntime
      • SSeat
      • SSkinnedMeshRenderer
      • SSphereCollider
      • SStateMachine
      • STerrain
      • STrailRenderer
      • SUIButton
      • SUICanvas
      • SUIDropdown
      • SUIImage
      • SUIInputField
      • SUILayout
      • SUIRawImage
      • SUIScrollbar
      • SUISlider
      • SUIText
      • SUIToggle
      • SUIToolTipHint
      • SVirtualCamera
      • SVoiceZone
    • Types
      • SAnimationState
      • SAnimatorStateInfo
      • SAvatar
      • SAvatarAppearance
      • SChatMessage
      • SColor
      • SCommandBuffer
      • SDateTime
      • SGameObject
      • SGenre
      • SGroupInfo
      • SInventoryItem
      • SJointLimits
      • SJointMotor
      • SJointSpring
      • SLandmark
      • SLayerMask
      • SMaterial
      • SMath
      • SMusicDirectory
      • SMusicStation
      • SMusicStationList
      • SNetworkMessageLua
      • SOutfit
      • SParticle
      • SPhysicsHit
      • SPublicRegion
      • SQuaternion
      • SRay
      • SRect
      • SResource
      • SScore
      • SScoreRank
      • SString
      • SSubRegion
      • STrackInfo
      • STuneIn
      • SUIRaycastResult
      • SUserRegions
      • SVector
      • SUserProfile
      • SSocialMedia
      • SWebResponse
  • Server Scripting
    • Library
      • SMath
    • Network
      • SShared
      • SWebservice
    • Region
      • SAvatar
      • SCell
      • SObject
      • SParcel
      • SParcelManager
      • SRegionScript
      • SScene
    • Storage
      • SDatabase
  • Guides
    • Persistence
    • Server Scripts
  • Sample Projects
    • Smart Lights
    • Trivia Box
  • Changelog
    • API Changelog
  • Support
    • Report An Issue
Powered by GitBook

Sinespace® is a registered trademark of Sine Wave Entertainment Ltd, All Rights Reserved.

On this page
  • Index
  • Properties Index
  • Properties
  • Enabled
  • Range
  • SpotAngle
  • Intensity
  • Color
  • Type
  • GameObject

Was this helpful?

Export as PDF
  1. Client Scripting
  2. Components

SLight

Index

Properties Index

Property Name

Properties

Enabled

bool Enabled get set

Enable/Disable this light.

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

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


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


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

Range

float Range get set

Get/Set the effective range of the light source.

Space.Host.ExecutingObject.Light.Range = 8.0
--the below script will make a slider set the Light's range
--[Add "slider" and "light" references to the Scripting Runtime component]

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

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

slider.OnValueChanged(OVC) 

SpotAngle

float SpotAngle get set

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

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)

Intensity

float Intensity get set

Property Description

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) 

Color

Get/Set the color of the light.

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)

Type

int Type get set

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

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)

GameObject

Property Description

theGameObject = Space.Host.ExecutingObject.Light.GameObject
PreviousSHingeJointNextSLineRenderer

Last updated 2 years ago

Was this helpful?

bool get set

float get set

float get set

float get set

SVector get set

SLightType get set

SGameObject get

Color get set

GameObject get

SVector
SGameObject
Enabled
Range
SpotAngle
Intensity
Color
Type
GameObject