The Emission and Shape modules help control how particles are created and where they come from in a particle system. This makes effects like smoke, fire, or sparks look real and interesting.
Emission and shape modules in Unity
Start learning this pattern below
Jump into concepts and practice - no test required
var emission = particleSystem.emission;
emission.rateOverTime = 10f;
var shape = particleSystem.shape;
shape.shapeType = ParticleSystemShapeType.Cone;You access the Emission and Shape modules through the main ParticleSystem object.
Each module has properties you can set to change how particles behave and appear.
var emission = particleSystem.emission;
emission.rateOverTime = 20f;var shape = particleSystem.shape; shape.shapeType = ParticleSystemShapeType.Sphere;
var emission = particleSystem.emission;
emission.SetBursts(new ParticleSystem.Burst[] {
new ParticleSystem.Burst(0f, 30),
new ParticleSystem.Burst(1f, 50)
});This script sets up a particle system to emit 15 particles per second from a cone shape with a 25-degree angle and 0.5 radius. Attach it to a GameObject with a ParticleSystem component.
using UnityEngine; public class SimpleParticleSetup : MonoBehaviour { public ParticleSystem particleSystem; void Start() { var emission = particleSystem.emission; emission.rateOverTime = 15f; var shape = particleSystem.shape; shape.shapeType = ParticleSystemShapeType.Cone; shape.angle = 25f; shape.radius = 0.5f; } }
Changing emission rate affects how dense the particle effect looks.
Shape module controls where particles start, so changing it changes the effect's style.
Remember to assign the ParticleSystem component in the inspector or via code before using these modules.
The Emission module controls how many particles are created and when.
The Shape module controls the area or shape where particles come from.
Using both together helps create realistic and dynamic particle effects.
Practice
Solution
Step 1: Understand the role of Emission module
The Emission module controls the rate and timing of particle creation in Unity's Particle System.Step 2: Compare with other options
Color, size, and speed are controlled by other modules like Color over Lifetime or Size over Lifetime, not Emission.Final Answer:
How many particles are created and when they appear -> Option AQuick Check:
Emission = particle count and timing [OK]
- Confusing Emission with Color or Size modules
- Thinking Emission controls particle speed
- Assuming Emission controls particle shape
Solution
Step 1: Recall correct syntax for Emission module access
In Unity, the Emission module is accessed via particleSystem.emission, which returns a struct with an enabled property.Step 2: Check each option's syntax
var emission = particleSystem.emission; emission.enabled = true; correctly stores emission module and sets enabled to true. Options B, C, and D use incorrect property names or casing.Final Answer:
var emission = particleSystem.emission; emission.enabled = true; -> Option AQuick Check:
Correct property is emission.enabled [OK]
- Using wrong property names like enable or enableEmission
- Incorrect capitalization of 'emission'
- Trying to set emission directly without storing it first
var shape = particleSystem.shape; shape.shapeType = ParticleSystemShapeType.Cone; shape.angle = 25f; shape.radius = 0.5f;What effect does this code have on the particle system's shape module?
Solution
Step 1: Identify the shape type set
The code sets shape.shapeType to ParticleSystemShapeType.Cone, so particles emit from a cone.Step 2: Understand angle and radius properties
Angle sets the cone's spread to 25 degrees, radius sets the base radius to 0.5 units.Final Answer:
Particles emit from a cone shape with a 25-degree angle and 0.5 radius -> Option CQuick Check:
shapeType = Cone, angle = 25, radius = 0.5 [OK]
- Confusing cone with sphere or circle
- Misunderstanding angle as radius
- Assuming radius applies to box shape
particleSystem.emission.enabled = true;
Solution
Step 1: Understand emission module struct behavior
Emission is a struct returned by particleSystem.emission; you must store it in a variable before modifying properties.Step 2: Explain why direct assignment fails
Directly setting particleSystem.emission.enabled causes a compile error because emission returns a copy, not a reference.Final Answer:
You cannot set emission.enabled directly; you must store the emission module first -> Option BQuick Check:
Store emission module before setting enabled [OK]
- Trying to set emission.enabled directly
- Assuming emission is a reference type
- Ignoring compiler errors about property assignment
Solution
Step 1: Configure Emission for bursts
Setting Emission rate over time to 0 stops continuous emission. Adding bursts with 10 particles every 2 seconds creates the desired burst effect.Step 2: Configure Shape for edge emission
Setting Shape to Circle and using 'arcMode' as 'Edge' makes particles emit only from the circle's edge, not inside.Final Answer:
Set Emission rate over time to 0, enable bursts with count 10 every 2 seconds; set Shape to Circle with 'arcMode' set to 'Edge'. -> Option DQuick Check:
Bursts + Circle edge emission = desired effect [OK]
- Using continuous emission instead of bursts
- Choosing wrong shape like sphere or box
- Not setting arcMode to Edge for circle shape
