Bird
Raised Fist0
Unityframework~20 mins

Sub-emitters in Unity - Practice Problems & Coding Challenges

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
Challenge - 5 Problems
🎖️
Sub-Emitter Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this Unity particle system code with sub-emitters?

Consider a particle system with a sub-emitter configured to emit particles on death of the main particles. What will be the total number of particles emitted if the main system emits 5 particles and each sub-emitter emits 3 particles on death?

Unity
using UnityEngine;

public class ParticleTest : MonoBehaviour {
    public ParticleSystem mainSystem;
    public ParticleSystem subEmitter;

    void Start() {
        mainSystem.Emit(5);
    }
}
A20
B5
C15
D8
Attempts:
2 left
💡 Hint

Remember each main particle triggers the sub-emitter on death, emitting 3 particles each.

🧠 Conceptual
intermediate
1:30remaining
Which statement best describes sub-emitters in Unity?

Choose the correct description of sub-emitters in Unity's particle system.

ASub-emitters are separate particle systems that can be triggered by events in the main particle system, like birth or death of particles.
BSub-emitters are used to combine multiple particle systems into one single system permanently.
CSub-emitters automatically replace the main particle system when it finishes emitting.
DSub-emitters are only used to change the color of particles in the main system.
Attempts:
2 left
💡 Hint

Think about how sub-emitters react to particle events.

🔧 Debug
advanced
2:30remaining
Why does the sub-emitter not emit particles on collision event?

Given this setup, the sub-emitter is configured to emit on collision, but no particles appear. What is the most likely cause?

Unity
ParticleSystem subEmitter;

void Setup() {
    var subEmitters = mainSystem.subEmitters;
    subEmitters.AddSubEmitter(subEmitter, ParticleSystemSubEmitterType.Collision, ParticleSystemSubEmitterProperties.InheritNothing);
}

// mainSystem has collision module enabled with collision events enabled.
ASub-emitters cannot be triggered by collision events in Unity.
BThe main particle system's collision module is not enabled or collision events are not enabled.
CThe sub-emitter must be added before the main system starts emitting particles.
DThe sub-emitter's emission rate is set to zero.
Attempts:
2 left
💡 Hint

Check the main system's collision settings.

📝 Syntax
advanced
1:30remaining
Identify the syntax error in adding a sub-emitter in Unity C# script.

Which option contains the correct syntax to add a sub-emitter to a particle system?

Unity
var subEmitters = mainSystem.subEmitters;
subEmitters.AddSubEmitter(subEmitter, ParticleSystemSubEmitterType.Death, ParticleSystemSubEmitterProperties.InheritColor);
AsubEmitters.AddSubEmitter(subEmitter; ParticleSystemSubEmitterType.Death, ParticleSystemSubEmitterProperties.InheritColor);
BsubEmitters.AddSubEmitter(subEmitter, ParticleSystemSubEmitterType.Death ParticleSystemSubEmitterProperties.InheritColor);
CsubEmitters.AddSubEmitter(subEmitter, ParticleSystemSubEmitterType.Death, ParticleSystemSubEmitterProperties.InheritColor);
DsubEmitters.AddSubEmitter(subEmitter, ParticleSystemSubEmitterType.Death, ParticleSystemSubEmitterProperties.InheritColor
Attempts:
2 left
💡 Hint

Look carefully at commas and parentheses.

🚀 Application
expert
3:00remaining
How to create a chain reaction of sub-emitters in Unity?

You want a particle system where the main system emits particles, each of which triggers a sub-emitter on death, and that sub-emitter also triggers another sub-emitter on death. How do you set this up correctly?

AConfigure the main system to emit all particles at once and rely on gravity to create the effect.
BAdd multiple sub-emitters directly to the main system, all set to trigger on death.
CUse one sub-emitter with a very high emission rate to simulate chain reaction.
DAdd a sub-emitter to the main system, then add a sub-emitter to that sub-emitter's particle system, each set to trigger on death.
Attempts:
2 left
💡 Hint

Think about how sub-emitters can themselves have sub-emitters.

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