0
0
Unityframework~10 mins

Emission and shape modules in Unity - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Emission and shape modules
Start Particle System
Emission Module
Calculate Emission Rate
Shape Module
Determine Particle Spawn Position
Spawn Particle
Repeat per frame
The particle system starts, emission module sets how many particles to create, shape module decides where they appear, then particles spawn and the cycle repeats.
Execution Sample
Unity
var ps = GetComponent<ParticleSystem>();
var emission = ps.emission;
emission.rateOverTime = 10f;
var shape = ps.shape;
shape.shapeType = ParticleSystemShapeType.Cone;
ps.Play();
This code sets the particle system to emit 10 particles per second from a cone shape and starts the system.
Execution Table
StepActionEmission RateShape TypeParticle Spawn PositionOutput
1Initialize Particle SystemDefault (varies)Default (varies)DefaultNo particles yet
2Set emission.rateOverTime = 1010 particles/secDefaultDefaultPrepare to emit 10 particles per second
3Set shape.shapeType = Cone10 particles/secConePositions inside cone volumeParticles will spawn inside cone
4Call ps.Play()10 particles/secConePositions inside cone volumeParticle system starts emitting
5Frame 1: Emit particles10 particles/secConeRandom position in coneParticles appear at cone positions
6Frame 2: Emit particles10 particles/secConeRandom position in coneMore particles appear
7Repeat emission each frame10 particles/secConeRandom position in coneContinuous particle emission
8Stop or disable system0 particles/secConeNo spawnEmission stops
💡 Emission stops when particle system is stopped or emission rate set to zero
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 5Final
emission.rateOverTimeDefault1010101010
shape.shapeTypeDefaultDefaultConeConeConeCone
particle spawn positionDefaultDefaultInside coneInside coneInside cone (varies)Inside cone (varies)
Key Moments - 3 Insights
Why do particles appear at different positions each frame even though the shape is fixed?
Because the shape module defines a volume (like a cone), particles spawn at random positions inside that volume each frame, as shown in execution_table rows 5 and 6.
What happens if emission.rateOverTime is set to zero after starting the system?
Emission stops immediately, so no new particles spawn, as shown in execution_table row 8.
Does changing the shape module after starting the system affect already spawned particles?
No, changing the shape affects only where new particles spawn, not existing ones, as seen between steps 3 and 5.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the emission rate after step 3?
A10 particles per second
B0 particles per second
CDefault emission rate
DEmission stopped
💡 Hint
Check the 'Emission Rate' column at step 3 in the execution_table.
At which step does the particle system start emitting particles?
AStep 2
BStep 4
CStep 1
DStep 8
💡 Hint
Look for the action 'Call ps.Play()' in the execution_table.
If the shape type is changed to Sphere after step 3, how would the particle spawn position change?
AParticles spawn at a single point
BParticles spawn inside a cone volume
CParticles spawn inside a sphere volume
DParticles stop spawning
💡 Hint
Refer to the 'Shape Type' and 'Particle Spawn Position' columns in the execution_table.
Concept Snapshot
Particle System Emission and Shape Modules:
- Emission module controls how many particles spawn per second.
- Shape module controls where particles appear (volume shape).
- Set emission.rateOverTime to control rate.
- Set shape.shapeType to control spawn area.
- Call Play() to start emitting particles.
Full Transcript
This visual execution shows how Unity's particle system uses emission and shape modules. First, the particle system is initialized with default settings. Then, the emission rate is set to 10 particles per second. Next, the shape module is set to a cone shape, which means particles will spawn inside a cone volume. When Play() is called, the system starts emitting particles at random positions inside the cone. Each frame, more particles spawn inside this volume. Emission stops when the system is stopped or the emission rate is set to zero. Variables like emission rate and shape type change step by step, affecting how and where particles appear. Key moments clarify why particles spawn at different positions and how changing settings affects emission. The quiz tests understanding of emission rate, start of emission, and shape effects.