0
0
Unityframework~30 mins

Emission and shape modules in Unity - Mini Project: Build & Apply

Choose your learning style9 modes available
Emission and Shape Modules in Unity Particle System
📖 Scenario: You are creating a simple particle effect in Unity to simulate fireworks. You want to control how particles are emitted and the shape from which they appear.
🎯 Goal: Build a Unity script that sets up a particle system with specific emission rate and shape settings using the Emission and Shape modules.
📋 What You'll Learn
Create a ParticleSystem component in the scene
Access and configure the Emission module to emit 50 particles per second
Access and configure the Shape module to emit particles from a cone shape
Print the emission rate and shape type to the console
💡 Why This Matters
🌍 Real World
Particle systems are used in games and simulations to create effects like fire, smoke, explosions, and magic spells.
💼 Career
Understanding how to configure particle systems is important for game developers and visual effects artists working with Unity.
Progress0 / 4 steps
1
Create a ParticleSystem variable
Create a ParticleSystem variable called ps and assign it to the ParticleSystem component attached to the same GameObject using GetComponent<ParticleSystem>().
Unity
Need a hint?

Use GetComponent<ParticleSystem>() to get the ParticleSystem component.

2
Configure the Emission module
Create a variable called emission of type ParticleSystem.EmissionModule and assign it from ps.emission. Then set emission.rateOverTime to 50f.
Unity
Need a hint?

Access the emission module via ps.emission and set rateOverTime.

3
Configure the Shape module
Create a variable called shape of type ParticleSystem.ShapeModule and assign it from ps.shape. Then set shape.shapeType to ParticleSystemShapeType.Cone.
Unity
Need a hint?

Access the shape module via ps.shape and set shapeType to Cone.

4
Print emission rate and shape type
Print the emission rate over time and the shape type to the console using Debug.Log. Use emission.rateOverTime.constant and shape.shapeType in the message.
Unity
Need a hint?

Use Debug.Log with f-strings to print the values.