Bird
Raised Fist0
Unityframework~10 mins

Sub-emitters in Unity - Step-by-Step Execution

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Concept Flow - Sub-emitters
Start Particle System
Emit Main Particles
Check Sub-emitter Trigger
Emit Sub-emitter
Sub-emitter Particles
End
The main particle system emits particles. When a particle event occurs (like birth or death), the sub-emitter triggers and emits its own particles.
Execution Sample
Unity
void OnParticleTrigger() {
  var sub = mainParticleSystem.subEmitters;
  sub.EmitSubEmitter(0, 5);
}
When the main particle system triggers, it emits 5 particles from its first sub-emitter.
Execution Table
StepActionMain Particle CountSub-emitter TriggeredSub-emitter Particle Count
1Start main particle system0No0
2Main system emits 3 particles3No0
3Particle event triggers sub-emitter3Yes0
4Sub-emitter emits 5 particles3Yes5
5Main system emits 2 more particles5No5
6No new trigger, particles continue5No5
7End of simulation5No5
💡 Simulation ends after fixed steps; no more triggers.
Variable Tracker
VariableStartAfter Step 2After Step 4After Step 5Final
Main Particle Count03355
Sub-emitter Particle Count00555
Sub-emitter TriggeredNoNoYesNoNo
Key Moments - 2 Insights
Why does the sub-emitter only emit particles after a trigger event?
Sub-emitters are designed to emit particles only when a specific event occurs in the main system, like particle birth or death, as shown in step 3 and 4 of the execution_table.
Does the main particle count increase when the sub-emitter emits particles?
No, the main particle count and sub-emitter particle count are tracked separately, as seen in steps 4 and 5 where main count stays at 3 while sub-emitter emits 5 particles.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does the sub-emitter first emit particles?
AStep 4
BStep 3
CStep 2
DStep 5
💡 Hint
Check the 'Sub-emitter Particle Count' column for when it changes from 0 to 5.
According to variable_tracker, what is the main particle count after step 5?
A3
B5
C0
D8
💡 Hint
Look at the 'Main Particle Count' row under 'After Step 5' column.
If the sub-emitter trigger never happens, what would the sub-emitter particle count be at the end?
A5
B3
C0
DCannot determine
💡 Hint
Refer to the 'Sub-emitter Particle Count' column in execution_table rows where 'Sub-emitter Triggered' is 'No'.
Concept Snapshot
Sub-emitters are particle systems triggered by events in a main particle system.
They emit particles only when triggered (e.g., on birth or death).
Main and sub-emitter particles are tracked separately.
Use subEmitters.EmitSubEmitter(index, count) to emit.
Useful for effects like sparks from explosions.
Full Transcript
This visual execution shows how a main particle system emits particles and triggers a sub-emitter to emit its own particles. The flow starts with the main system emitting particles. When a trigger event occurs, the sub-emitter activates and emits particles separately. The execution table tracks particle counts and trigger states step-by-step. Key moments clarify that sub-emitters only emit on events and do not increase main particle counts. The quiz tests understanding of when sub-emitters emit and particle counts at various steps. The snapshot summarizes usage and behavior of sub-emitters in Unity particle systems.

Practice

(1/5)
1. What is the main purpose of sub-emitters in Unity's particle system?
easy
A. To change the color of particles over time
B. To control the speed of the main particle system
C. To pause and resume particle emission
D. To create extra particle effects triggered by main particles

Solution

  1. Step 1: Understand sub-emitters role

    Sub-emitters are used to add extra effects that happen when main particles do something.
  2. Step 2: Identify correct purpose

    They trigger new particles on events like birth, death, or collision of main particles.
  3. Final Answer:

    To create extra particle effects triggered by main particles -> Option D
  4. Quick Check:

    Sub-emitters = extra triggered effects [OK]
Hint: Sub-emitters add effects triggered by main particles [OK]
Common Mistakes:
  • Thinking sub-emitters control particle speed
  • Confusing sub-emitters with color changes
  • Assuming sub-emitters pause emission
2. Which of the following is the correct way to add a sub-emitter in Unity's Particle System component?
easy
A. In the Particle System inspector, expand Sub Emitters and click '+' to add a sub-emitter
B. Add a new Particle System component to the same GameObject
C. Use the Animator window to link particle effects
D. Write a script to manually spawn particles without using sub-emitters

Solution

  1. Step 1: Locate sub-emitter settings

    In Unity's Particle System inspector, there is a Sub Emitters section to manage sub-emitters.
  2. Step 2: Add sub-emitter correctly

    You add a sub-emitter by clicking the '+' button inside that section to assign a particle system as sub-emitter.
  3. Final Answer:

    In the Particle System inspector, expand Sub Emitters and click '+' to add a sub-emitter -> Option A
  4. Quick Check:

    Sub Emitters panel '+' button = add sub-emitter [OK]
Hint: Use '+' in Sub Emitters section to add sub-emitters [OK]
Common Mistakes:
  • Adding a separate Particle System component instead
  • Trying to link particles via Animator window
  • Spawning particles only by script without sub-emitters
3. Consider a particle system with a sub-emitter set to trigger on particle death. What happens when a main particle dies?
medium
A. The main particle system stops emitting particles
B. The sub-emitter changes the color of the main particle
C. The sub-emitter spawns its particles at the main particle's death position
D. Nothing happens because sub-emitters only trigger on birth

Solution

  1. Step 1: Understand sub-emitter trigger types

    Sub-emitters can trigger on birth, death, or collision of main particles.
  2. Step 2: Effect of death trigger

    When a main particle dies, the sub-emitter spawns its own particles at that exact position.
  3. Final Answer:

    The sub-emitter spawns its particles at the main particle's death position -> Option C
  4. Quick Check:

    Death trigger = spawn sub-particles at death spot [OK]
Hint: Death trigger spawns sub-particles at main particle's position [OK]
Common Mistakes:
  • Thinking sub-emitters stop main emission
  • Believing sub-emitters change main particle color
  • Assuming sub-emitters only trigger on birth
4. You set up a sub-emitter to trigger on collision, but no sub-particles appear when main particles collide. What is the most likely cause?
medium
A. The sub-emitter particle system is not assigned in the Sub Emitters list
B. The main particle system has no collision module enabled
C. The sub-emitter is set to trigger on birth instead of collision
D. The main particle system's emission rate is zero

Solution

  1. Step 1: Check collision module status

    For sub-emitters to trigger on collision, the main particle system must have collision enabled.
  2. Step 2: Identify cause of no sub-particles

    If collision is off, no collision events happen, so sub-emitters won't trigger.
  3. Final Answer:

    The main particle system has no collision module enabled -> Option B
  4. Quick Check:

    Collision off = no collision trigger for sub-emitters [OK]
Hint: Enable collision module for collision-triggered sub-emitters [OK]
Common Mistakes:
  • Not assigning sub-emitter particle system
  • Setting wrong trigger type
  • Having zero emission rate but expecting collisions
5. You want to create a firework effect where each main particle explodes into smaller sparks on death, and each spark also creates a small smoke puff on its own death. How do you set this up using sub-emitters?
hard
A. Add a sub-emitter to the main particle system triggered on death for sparks, then add a sub-emitter to the sparks system triggered on death for smoke
B. Add all effects as sub-emitters to the main particle system triggered on birth
C. Use only one particle system with color changes to simulate sparks and smoke
D. Spawn sparks and smoke manually via script without sub-emitters

Solution

  1. Step 1: Setup main particle system with death-triggered sparks

    Add a sub-emitter to the main system that triggers on death to spawn spark particles.
  2. Step 2: Setup sparks particle system with death-triggered smoke

    Add a sub-emitter to the sparks system that triggers on death to spawn smoke puffs.
  3. Step 3: Chain sub-emitters for layered effects

    This chaining creates the firework effect with sparks and smoke triggered sequentially.
  4. Final Answer:

    Add a sub-emitter to the main particle system triggered on death for sparks, then add a sub-emitter to the sparks system triggered on death for smoke -> Option A
  5. Quick Check:

    Chain death-triggered sub-emitters for layered effects [OK]
Hint: Chain sub-emitters triggered on death for multi-layer effects [OK]
Common Mistakes:
  • Adding all effects on birth triggers only
  • Using one system with color changes only
  • Avoiding sub-emitters and scripting manually