CodeBlanks Logo Icon CodeBlanks

Emission and Shape

Learn the Emission rate and Shape modules.

Emission Module

The Emission module determines the rate and bursts with which particles appear. The rateOverTime property controls how many particles are spawned per second. Additionally, a burst can be configured for sudden explosions, launching dozens of particles in a single frame.

var emission = ps.emission;
emission.rateOverTime = 25f;

Shape Module

The Shape module controls the geometric volume from which particles spawn and the directions in which they scatter. Common shapes include Cone (torches and rocket engines), Sphere (explosions), and Box (rain and snow). Narrowing the angle focuses particles in a specific direction.

var shape = ps.shape;
shape.shapeType = ParticleSystemShapeType.Cone;

Practice Read Emission Rate

Assign emission.rateOverTime to variable hiz and print it with Debug.Log("Uretim: " + hiz);.

Starter code

Player.cs
using System;

public class EmissionModule
{
    public float rateOverTime = 20f;
}

public static class Debug
{
    public static void Log(object message) => Console.WriteLine(message);
}

public class Program
{
    public static void Main()
    {
        EmissionModule emission = new EmissionModule();
        // Yayilim hizini oku ve konsola yazdir
    }
}

Sample solution

Player.cs
using System;

public class EmissionModule
{
    public float rateOverTime = 20f;
}

public static class Debug
{
    public static void Log(object message) => Console.WriteLine(message);
}

public class Program
{
    public static void Main()
    {
        EmissionModule emission = new EmissionModule();
        float hiz = emission.rateOverTime;
        Debug.Log("Uretim: " + hiz);
    }
}

Expected output

Uretim: 20

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which property in the Emission module determines the continuous amount of particles spawned per second?

  • maxParticles
  • simulationSpeed
  • startSpeed
  • rateOverTime Correct answer

Explanation: rateOverTime determines the number of particles emitted per second over time.

2 Set Emission Rate

Question
emission.____ = 50f;
Answer
emission.rateOverTime = 50f;

Explanation: The rateOverTime property is used to configure the particle emission rate per second.

3 Module and Parameter Matching

Term Meaning
Emission Module setting particle emission rate
rateOverTime Number of particles emitted per second
Shape Geometric volume of emitted particles
Burst Instant burst of multiple particles

All lessons in Intermediate