Bird
Raised Fist0
Unityframework~15 mins

Sub-emitters in Unity - Deep Dive

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
Overview - Sub-emitters
What is it?
Sub-emitters are special particle systems that are triggered by events in a main particle system, such as when a particle is born, dies, or collides. They allow you to create complex visual effects by chaining multiple particle systems together. This means one particle system can cause another to start, making effects like explosions with sparks or smoke more dynamic and realistic.
Why it matters
Without sub-emitters, creating detailed particle effects would require manually timing and controlling many separate particle systems, which is hard and error-prone. Sub-emitters automate this process, making effects more natural and easier to manage. This improves game visuals and performance by keeping related effects connected and synchronized.
Where it fits
Before learning sub-emitters, you should understand basic Unity particle systems and how to create simple effects. After mastering sub-emitters, you can explore advanced particle system features like custom shaders, particle collisions, and performance optimization.
Mental Model
Core Idea
Sub-emitters are like fireworks that launch smaller fireworks when they explode, creating a chain of effects triggered by particle events.
Think of it like...
Imagine a birthday cake with candles. When you blow out one candle (main particle), it sparks smaller candles (sub-emitters) to light up, creating a beautiful chain reaction of lights.
Main Particle System
  │
  ├─ On Birth ──▶ Sub-emitter A (e.g., sparks)
  │
  ├─ On Death ──▶ Sub-emitter B (e.g., smoke)
  │
  └─ On Collision ─▶ Sub-emitter C (e.g., sparks flying)

Each arrow shows when a sub-emitter triggers based on main particle events.
Build-Up - 7 Steps
1
FoundationUnderstanding Basic Particle Systems
🤔
Concept: Learn what a particle system is and how it creates visual effects using many small particles.
A particle system in Unity emits many tiny images or shapes called particles. These particles can move, change color, size, and disappear over time. For example, a fire effect uses many small orange and yellow particles that flicker and fade.
Result
You can create simple effects like smoke, fire, or rain by adjusting particle system settings.
Knowing how a single particle system works is essential before combining multiple systems with sub-emitters.
2
FoundationEvents That Trigger Particle Actions
🤔
Concept: Particles can trigger events like birth, death, or collision, which can be used to start other effects.
Each particle in a system has a life cycle: it is born, moves, and then dies. It can also collide with objects. Unity lets you detect these events to trigger actions. For example, when a particle dies, you might want to create a puff of smoke.
Result
You understand that particle events can be hooks to start new effects.
Recognizing particle events as triggers opens the door to chaining effects dynamically.
3
IntermediateIntroducing Sub-emitters in Unity
🤔
Concept: Sub-emitters are particle systems linked to main particles that start on specific events like birth, death, or collision.
In Unity's Particle System component, you can add sub-emitters under the 'Sub Emitters' module. You assign another particle system to trigger when a particle is born, dies, or collides. For example, sparks can be sub-emitters triggered on collision to simulate sparks flying off.
Result
You can create layered effects where one particle system causes another to start automatically.
Using sub-emitters simplifies complex effects by automating the start of related particle systems.
4
IntermediateConfiguring Sub-emitter Events and Settings
🤔Before reading on: Do you think sub-emitters can trigger on multiple events simultaneously or only one event per sub-emitter? Commit to your answer.
Concept: Learn how to set which event triggers a sub-emitter and how to control its behavior.
Each sub-emitter can be set to trigger on one event: birth, death, or collision. You can add multiple sub-emitters to cover different events. You also control if the sub-emitter inherits velocity or color from the parent particle, affecting realism.
Result
You can fine-tune how and when sub-emitters activate, making effects more natural.
Understanding event-specific triggers and inheritance lets you create believable chained effects.
5
IntermediatePractical Example: Explosion with Sparks and Smoke
🤔Before reading on: Will adding sub-emitters increase or decrease the performance cost of your particle effect? Commit to your answer.
Concept: Apply sub-emitters to build a multi-stage explosion effect with sparks on collision and smoke on death.
Create a main explosion particle system. Add a sub-emitter for sparks triggered on collision, so sparks fly when particles hit surfaces. Add another sub-emitter for smoke triggered on death, so smoke appears as particles vanish. Adjust sizes and colors for realism.
Result
You get a dynamic explosion effect where sparks and smoke appear naturally without manual timing.
Seeing sub-emitters in action clarifies how they automate complex visual storytelling in effects.
6
AdvancedPerformance Considerations and Optimization
🤔Before reading on: Do you think using many sub-emitters always improves performance? Commit to your answer.
Concept: Learn how sub-emitters affect performance and how to optimize particle systems in production.
Each sub-emitter adds more particles and calculations, which can slow down your game if overused. Use sub-emitters sparingly and limit particle counts. Use GPU particle systems when possible. Also, disable sub-emitters when not visible to save resources.
Result
You can balance visual quality and performance by smart use of sub-emitters.
Knowing the cost of sub-emitters helps prevent slowdowns and keeps games running smoothly.
7
ExpertAdvanced Control with Scripts and Custom Events
🤔Before reading on: Can sub-emitters be triggered manually via code, or only through built-in particle events? Commit to your answer.
Concept: Explore how to control sub-emitters beyond built-in events using scripting for custom behaviors.
Unity allows you to control particle systems via scripts. You can start or stop sub-emitters manually or trigger them based on game logic, not just particle events. This enables effects like conditional explosions or chaining effects based on player actions. You can also modify sub-emitter parameters at runtime for dynamic visuals.
Result
You gain full control over sub-emitters, enabling complex, interactive effects.
Understanding script control unlocks creative possibilities beyond default particle event triggers.
Under the Hood
Sub-emitters work by listening to specific events in the main particle system's lifecycle. When a particle is born, dies, or collides, the main system signals the sub-emitter to emit its own particles. Internally, Unity manages these linked systems so that sub-emitters inherit properties like position and velocity from the triggering particle, ensuring smooth visual continuity.
Why designed this way?
Sub-emitters were designed to simplify creating complex chained effects without manually syncing multiple particle systems. This design reduces developer effort and errors while improving performance by tightly coupling related effects. Alternatives like manually triggering separate systems were error-prone and harder to maintain.
Main Particle System
┌─────────────────────────────┐
│ Particle Lifecycle Events    │
│ ┌───────────────┐           │
│ │ Birth Event   │───────────┼─────▶ Sub-emitter A
│ ├───────────────┤           │
│ │ Death Event   │───────────┼─────▶ Sub-emitter B
│ ├───────────────┤           │
│ │ Collision     │───────────┼─────▶ Sub-emitter C
│ └───────────────┘           │
└─────────────────────────────┘

Sub-emitters inherit position, velocity, and optionally color from triggering particles.
Myth Busters - 4 Common Misconceptions
Quick: Do sub-emitters always improve performance because they automate effects? Commit to yes or no.
Common Belief:Sub-emitters always make particle effects more efficient and faster.
Tap to reveal reality
Reality:Sub-emitters add more particles and processing, which can decrease performance if overused or not optimized.
Why it matters:Ignoring performance impact can cause frame rate drops and poor game experience.
Quick: Can a single sub-emitter respond to multiple events like birth and death simultaneously? Commit to yes or no.
Common Belief:One sub-emitter can trigger on multiple particle events at once.
Tap to reveal reality
Reality:Each sub-emitter can only be assigned to one event type; to cover multiple events, you need multiple sub-emitters.
Why it matters:Misunderstanding this leads to missing effects or unexpected behavior in particle chains.
Quick: Are sub-emitters only visual and cannot be controlled by scripts? Commit to yes or no.
Common Belief:Sub-emitters can only be triggered automatically by particle events and cannot be controlled manually.
Tap to reveal reality
Reality:Sub-emitters can be controlled and triggered via scripts for advanced, dynamic effects beyond automatic events.
Why it matters:Believing this limits creative use and interactive effect design.
Quick: Does a sub-emitter always inherit all properties from the parent particle? Commit to yes or no.
Common Belief:Sub-emitters inherit all properties like color, velocity, and size from the triggering particle by default.
Tap to reveal reality
Reality:Inheritance is optional and configurable; some properties may not be inherited unless explicitly set.
Why it matters:Assuming full inheritance can cause unexpected visual results or bugs.
Expert Zone
1
Sub-emitters can inherit velocity and color selectively, allowing fine control over how child particles behave relative to their parent.
2
Multiple sub-emitters can be stacked on a single particle system, each responding to different events, enabling complex multi-stage effects.
3
Using GPU particle systems with sub-emitters requires careful setup because not all features are supported, affecting performance and visuals.
When NOT to use
Avoid sub-emitters when you need completely independent particle systems with no event linkage or when performance is critical and simpler effects suffice. Instead, use separate particle systems triggered by game logic or animation events.
Production Patterns
In games, sub-emitters are used for effects like explosions with sparks and smoke, magic spells with trailing particles, and environmental effects like leaves falling and scattering dust. Professionals combine sub-emitters with scripting to create responsive, interactive visuals tied to gameplay.
Connections
Event-driven programming
Sub-emitters rely on events (birth, death, collision) to trigger actions, similar to event-driven code that reacts to user input or system changes.
Understanding event-driven programming helps grasp how sub-emitters respond automatically to particle lifecycle events without manual polling.
Chain reactions in chemistry
Sub-emitters create chain reactions where one event triggers another, like chemical reactions where one molecule's change causes others to react.
Seeing sub-emitters as chain reactions clarifies how small triggers can create complex, cascading effects.
Modular design in engineering
Sub-emitters embody modular design by linking small, reusable particle systems to build complex effects without monolithic code.
Recognizing modularity in sub-emitters encourages building maintainable and scalable visual effects.
Common Pitfalls
#1Adding too many sub-emitters without performance checks
Wrong approach:MainParticleSystem.subEmitters.Add(sparksEmitter); MainParticleSystem.subEmitters.Add(smokeEmitter); MainParticleSystem.subEmitters.Add(extraEmitter); // No limit or optimization
Correct approach:Use only necessary sub-emitters and optimize particle counts: if (performanceIsGood) { MainParticleSystem.subEmitters.Add(sparksEmitter); MainParticleSystem.subEmitters.Add(smokeEmitter); }
Root cause:Assuming more sub-emitters always improve visuals without considering performance impact.
#2Assigning one sub-emitter to multiple events expecting all to trigger
Wrong approach:MainParticleSystem.subEmitters.SetSubEmitter(0, sparksEmitter, ParticleSystemSubEmitterType.Birth); MainParticleSystem.subEmitters.SetSubEmitter(0, sparksEmitter, ParticleSystemSubEmitterType.Death); // overwrites previous
Correct approach:Assign separate sub-emitters for each event: MainParticleSystem.subEmitters.SetSubEmitter(0, sparksEmitter, ParticleSystemSubEmitterType.Birth); MainParticleSystem.subEmitters.SetSubEmitter(1, smokeEmitter, ParticleSystemSubEmitterType.Death);
Root cause:Misunderstanding that one sub-emitter slot can only handle one event type.
#3Expecting sub-emitters to inherit all properties automatically
Wrong approach:SubEmitterModule.inheritColor = false; SubEmitterModule.inheritVelocity = false; // but expecting color and velocity inheritance anyway
Correct approach:Explicitly enable inheritance: SubEmitterModule.inheritColor = true; SubEmitterModule.inheritVelocity = true;
Root cause:Not configuring inheritance settings leads to unexpected visual differences.
Key Takeaways
Sub-emitters let one particle system trigger others on particle events, enabling complex chained effects.
They simplify creating dynamic visuals like explosions with sparks and smoke by automating effect timing.
Each sub-emitter triggers on only one event type, so multiple sub-emitters are needed for multiple triggers.
While powerful, sub-emitters add performance cost and should be used thoughtfully and optimized.
Advanced control via scripting unlocks interactive and conditional particle effects beyond automatic triggers.

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