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
  • Functions Index
  • Properties Index
  • Functions
  • Play
  • Stop
  • Pause
  • Clear
  • IsAlive
  • Emit
  • Simulate
  • SetTriggerParticles
  • GetTriggerParticles
  • Properties
  • StartDelay
  • IsPlaying
  • IsEmitting
  • IsStopped
  • IsPaused
  • Loop
  • PlayOnAwake
  • Time
  • Duration
  • PlaybackSpeed
  • ParticleCount
  • EnableEmission
  • EmissionRate
  • EmissionRateOverTime
  • EmissionRateOverDistance
  • StartSpeed
  • StartSize
  • StartColor
  • StartRotation
  • StartRotation3D
  • StartLifetime
  • GravityModifier
  • MaxParticles
  • RandomSeed
  • UseAutoRandomSeed
  • GameObject

Was this helpful?

Export as PDF
  1. Client Scripting
  2. Components

SParticleSystem

Index

Functions Index

Function Name

Properties Index

Property Name
Description

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

Determines whether the Particle System is playing.

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.

Determines whether the Particle System is stopped.

Determines whether the Particle System is paused.

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.

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.

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

The duration of the Particle System in seconds.

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

The current number of particles.

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

The rate of particle emission.

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

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

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

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

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

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.

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.

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.

A scale that this Particle System applies to gravity.

The maximum number of particles to emit.

Override the random seed used for the Particle System emission.

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).

Functions

Play

void Play (bool withChildren) void Play ()

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

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

Parameter
Type
Description

Space.Host.ExecutingObject.ParticleSystem.Play()
--or
Space.Host.ExecutingObject.ParticleSystem.Play(true)

Stop

void Stop (bool withChildren) void Stop ()

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

Parameter
Type
Description

Space.Host.ExecutingObject.ParticleSystem.Stop()
--or
Space.Host.ExecutingObject.ParticleSystem.Stop(true)

Pause

void Pause (bool withChildren) void Pause ()

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

Parameter
Type
Description

Space.Host.ExecutingObject.ParticleSystem.Pause()
--or
Space.Host.ExecutingObject.ParticleSystem.Pause(true)

Clear

void Clear (bool withChildren) void Clear ()

Remove all particles in the Particle System.

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

Parameter
Type
Description

Space.Host.ExecutingObject.ParticleSystem.Clear()
--or
Space.Host.ExecutingObject.ParticleSystem.Clear(true)

IsAlive

bool IsAlive (bool withChildren)

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

Parameter
Type
Description

isAlive = Space.Host.ExecutingObject.ParticleSystem.IsAlive()
--or
isAlive = Space.Host.ExecutingObject.ParticleSystem.IsAlive(true)

Emit

void Emit (int count)

Emit 'count' particles immediately.

Parameter
Type
Description

Space.Host.ExecutingObject.ParticleSystem.Emit(100)

Simulate

void Simulate (float time)

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

Parameter
Type
Description

Space.Host.ExecutingObject.ParticleSystem.Simulate(5.0)

SetTriggerParticles

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

Parameter
Type
Description

type

int

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

sp

A table of SParticle

Space.Host.ExecutingObject.ParticleSystem.SetTriggerParticles(0,ParticlesArray)

GetTriggerParticles

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

Parameter
Type
Description

type

int

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

ParticlesArray = Space.Host.ExecutingObject.ParticleSystem.GetTriggerParticles(0)

Properties

StartDelay

float StartDelay get set

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

Space.Host.ExecutingObject.ParticleSystem.StartDelay = 5

IsPlaying

bool IsPlaying get

Determines whether the Particle System is playing.

isPlaying = Space.Host.ExecutingObject.ParticleSystem.IsPlaying

IsEmitting

bool IsEmitting get

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

isEmitting = Space.Host.ExecutingObject.ParticleSystem.IsEmitting

IsStopped

bool IsStopped get

Determines whether the Particle System is stopped.

isStopped = Space.Host.ExecutingObject.ParticleSystem.IsStopped

IsPaused

bool IsPaused get

Determines whether the Particle System is paused.

isPaused = Space.Host.ExecutingObject.ParticleSystem.IsPaused

Loop

bool Loop get set

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

Space.Host.ExecutingObject.ParticleSystem.Loop = true

PlayOnAwake

bool PlayOnAwake get set

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

Space.Host.ExecutingObject.ParticleSystem.PlayOnAwake

Time

float Time get set

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

Space.Host.ExecutingObject.ParticleSystem.Time = 5.0

Duration

float Duration get

The duration of the Particle System in seconds.

duration = Space.Host.ExecutingObject.ParticleSystem.Duration

PlaybackSpeed

float PlaybackSpeed get set

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

Space.Host.ExecutingObject.ParticleSystem.PlaybackSpeed =  1.5

ParticleCount

int ParticleCount get

The current number of particles.

count = Space.Host.ExecutingObject.ParticleSystem.ParticleCount

EnableEmission

bool EnableEmission get set

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

Space.Host.ExecutingObject.ParticleSystem.EnableEmission = true

EmissionRate

float EmissionRate get set

The rate of particle emission.

 Space.Host.ExecutingObject.ParticleSystem.EmissionRate = 10 

EmissionRateOverTime

float EmissionRateOverTime get set

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

 Space.Host.ExecutingObject.ParticleSystem.EmissionRateOverTime = 10 

EmissionRateOverDistance

float EmissionRateOverDistance get set

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

 Space.Host.ExecutingObject.ParticleSystem.EmissionRateOverDistance = 10 

StartSpeed

float StartSpeed get set

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

 Space.Host.ExecutingObject.ParticleSystem.StartSpeed = 10 

StartSize

float StartSize get set

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

 Space.Host.ExecutingObject.ParticleSystem.StartSize = 1.2 

StartColor

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

 Space.Host.ExecutingObject.ParticleSystem.StartColor = Color.Red

StartRotation

float StartRotation get set

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

 Space.Host.ExecutingObject.ParticleSystem.StartRotation = 20.5

StartRotation3D

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.

 Space.Host.ExecutingObject.ParticleSystem.StartRotation3D = Vector.New(0,20,20) 

StartLifetime

float StartLifetime get set

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

 Space.Host.ExecutingObject.ParticleSystem.StartLifetime = 20 

GravityModifier

float GravityModifier get set

A scale that this Particle System applies to gravity.

 Space.Host.ExecutingObject.ParticleSystem.GravityModifier = 1.2 

MaxParticles

int MaxParticles get set

The maximum number of particles to emit.

 Space.Host.ExecutingObject.ParticleSystem.MaxParticles = 500

RandomSeed

uint RandomSeed get set

Override the random seed used for the Particle System emission.

 Space.Host.ExecutingObject.ParticleSystem.RandomSeed = 23423423 
spawningparticles = Space.Scene.Find("Particles")
--get particle object and get the particle system component on it.
particles=spawningparticles.ParticleSystem
--set random seed.
particles.UseAutoRandomSeed = false
particles.RandomSeed = 123456

UseAutoRandomSeed

bool UseAutoRandomSeed get set

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

Space.Host.ExecutingObject.ParticleSystem.UseAutoRandomSeed = true 

GameObject

Property Description

theGameObject = Space.Host.ExecutingObject.ParticleSystem.GameObject
PreviousSNetworkingNextSPlayableDirector

Last updated 2 years ago

Was this helpful?

void (bool withChildren) void ()

void (bool withChildren) void ()

void (bool withChildren) void ()

void (bool withChildren) void ()

bool (bool withChildren)

void (int count)

void (float time)

void (SParticleSystemTriggerEventType type, SParticle[] sp)

SParticle[] (SParticleSystemTriggerEventType type)

float get set

bool get

bool get

bool get

bool get

bool get set

bool get set

float get set

float get

float get set

int get

bool get set

float get set

float get set

float get set

float get set

float get set

SColor get set

float get set

SVector get set

float get set

float get set

int get set

uint get set

bool get set

SGameObject get

void SetTriggerParticles (int type, [] sp)

[]

[] GetTriggerParticles (int type)

StartColor get set

StartRotation3D get set

GameObject get

SParticle
SParticle
SColor
SVector
SGameObject
Play
Play
Stop
Stop
Pause
Pause
Clear
Clear
IsAlive
Emit
Simulate
SetTriggerParticles
GetTriggerParticles
StartDelay
IsPlaying
IsEmitting
IsStopped
IsPaused
Loop
PlayOnAwake
Time
Duration
PlaybackSpeed
ParticleCount
EnableEmission
EmissionRate
EmissionRateOverTime
EmissionRateOverDistance
StartSpeed
StartSize
StartColor
StartRotation
StartRotation3D
StartLifetime
GravityModifier
MaxParticles
RandomSeed
UseAutoRandomSeed
GameObject
SParticle