Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ParticleSystem

Namespace: UnityEngine

/

Inherits from: Component

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Description

Script interface for particle systems (Shuriken).

See Also: Particle.

Variables

durationThe duration of the particle system in seconds (Read Only).
emissionRateThe rate of emission.
enableEmissionWhen set to false, the particle system will not emit particles.
gravityModifierScale being applied to the gravity defined by Physics.gravity.
isPausedIs the particle system paused right now ?
isPlayingIs the particle system playing right now ?
isStoppedIs the particle system stopped right now ?
loopIs the particle system looping?
maxParticlesThe maximum number of particles to emit.
particleCountThe current number of particles (Read Only).
playbackSpeedThe playback speed of the particle system. 1 is normal playback speed.
playOnAwakeIf set to true, the particle system will automatically start playing on startup.
randomSeedRandom seed used for the particle system emission. If set to 0, it will be assigned a random value on awake.
simulationSpaceThis selects the space in which to simulate particles. It can be either world or local space.
startColorThe initial color of particles when emitted.
startDelayStart delay in seconds.
startLifetimeThe total lifetime in seconds that particles will have when emitted. When using curves, this values acts as a scale on the curve. This value is set in the particle when it is create by the particle system.
startRotationThe initial rotation of particles when emitted. When using curves, this values acts as a scale on the curve.
startSizeThe initial size of particles when emitted. When using curves, this values acts as a scale on the curve.
startSpeedThe initial speed of particles when emitted. When using curves, this values acts as a scale on the curve.
timePlayback position in seconds.

Public Functions

ClearRemove all particles in the particle system.
EmitEmit count particles immediately.
GetParticlesGet the particles of this particle system.
IsAliveDoes the system have any live particles (or will produce more)?
PausePauses playing the particle system.
PlayPlays the particle system.
SetParticlesSet the particles of this particle system. size is the number of particles that is set.
SimulateFastforwards the particle system by simulating particles over given period of time, then pauses it.
StopStops playing the particle system.

Inherited members

Variables

gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagThe tag of this game object.
transformThe Transform attached to this GameObject (null if there is none attached).
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public Functions

BroadcastMessageCalls the method named methodName on every MonoBehaviour in this game object or any of its children.
CompareTagIs this game object tagged with tag ?
GetComponentReturns the component of Type type if the game object has one attached, null if it doesn't.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageCalls the method named methodName on every MonoBehaviour in this game object.
SendMessageUpwardsCalls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.

Static Functions

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares if two objects refer to the same.