Version: 5.4 beta (switch to 5.3)
LanguageEnglish
  • C#
  • JS

Script language

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

ParticleSystem

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

When setting properties on particle modules, the settings are passed immediately into native code. This gives the best performance. This means that setting properties on a module struct doesn't set something in script that requires setting back to the particle system. It all happens automatically.

See Also: Particle.

Variables

collisionAccess the particle system collision module.
colorBySpeedAccess the particle system color by lifetime module.
colorOverLifetimeAccess the particle system color over lifetime module.
durationThe duration of the particle system in seconds (Read Only).
emissionAccess the particle system emission module.
externalForcesAccess the particle system external forces module.
forceOverLifetimeAccess the particle system force over lifetime module.
gravityModifierScale being applied to the gravity defined by Physics.gravity.
inheritVelocityAccess the particle system velocity inheritance module.
isPausedIs the particle system paused right now ?
isPlayingIs the particle system playing right now ?
isStoppedIs the particle system stopped right now ?
limitVelocityOverLifetimeAccess the particle system limit velocity over lifetime module.
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.
rotationBySpeedAccess the particle system rotation by speed module.
rotationOverLifetimeAccess the particle system rotation over lifetime module.
scalingModeThe scaling mode applied to particle sizes and positions.
shapeAccess the particle system shape module.
simulationSpaceThis selects the space in which to simulate particles. It can be either world or local space.
sizeBySpeedAccess the particle system size by speed module.
sizeOverLifetimeAccess the particle system size over lifetime module.
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.
startRotation3DThe initial 3D rotation of particles when emitted. When using curves, this values acts as a scale on the curves.
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.
subEmittersAccess the particle system sub emitters module.
textureSheetAnimationAccess the particle system texture sheet animation module.
timePlayback position in seconds.
triggerAccess the particle system trigger module.
velocityOverLifetimeAccess the particle system velocity over lifetime module.

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.
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.
InstantiateReturns a copy of the object original.

Operators

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