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
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.