0
0
Unityframework~3 mins

Why Sub-emitters in Unity? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if your particle effects could trigger new effects all by themselves, making your scenes come alive effortlessly?

The Scenario

Imagine you are creating a firework effect in Unity. You want sparks to fly out, and when those sparks hit the ground, you want smaller sparks to burst out. Doing this manually means tracking each spark and creating new effects by hand.

The Problem

Manually managing each particle and its follow-up effects is slow and complicated. It's easy to miss connections, causing effects to look unnatural or break. You spend too much time writing extra code and debugging.

The Solution

Sub-emitters let you attach extra particle effects that automatically trigger when particles die or collide. This means you can create complex, layered effects easily without extra code for each step.

Before vs After
Before
if (spark hits ground) { create new sparks effect; }
After
sparkParticleSystem.subEmitters.AddSubEmitter(sparksOnDeath, ParticleSystemSubEmitterType.Death, ParticleSystemSubEmitterProperties.InheritNothing);
What It Enables

Sub-emitters let you build rich, dynamic particle effects that react naturally and automatically, making your scenes more alive and immersive.

Real Life Example

Think of a campfire: embers float up, then burst into tiny sparks when they fade. Sub-emitters handle this chain of effects smoothly without extra coding.

Key Takeaways

Manual particle chaining is complex and error-prone.

Sub-emitters automate triggering of new effects from existing particles.

This creates natural, layered visual effects with less code.