Course Content
Unity for Beginners
Unity for Beginners
Particles System
In Unity, a particle system is a powerful tool used for creating various visual effects such as fire, smoke, explosions, rain, sparks, and more. It's essentially a collection of small, simple objects (particles) that are generated and controlled dynamically to create complex effects.
When we create a particle system this is it's interface in the inspector
Key properties
Lifetime: Determines how long each particle exists before disappearing. Specified in seconds.
Start Color: Defines the initial color of particles when they are emitted. Can be a single color or a gradient, allowing for smooth color transitions.
Start Size: Specifies the initial size of particles upon emission. Size can be uniform for all particles or randomized within a range.
Start Speed: Sets the initial velocity of particles when they are emitted. Determines how fast particles move away from the emitter.
Rotation: Determines whether particles rotate and how they rotate over their lifetime. Rotation can add realism to effects like smoke, fire, or debris.
Emission
Rate Over Time: This property controls the number of particles emitted per second.
It's a straightforward way to adjust the density of particle effects.
For example, setting a rate of 10 particles per second means that every second, 10 new particles will be emitted from the emitter.
Bursts: Burst emission allows you to emit particles in bursts rather than continuously.
You can define specific intervals during which a large number of particles are emitted all at once.
This is useful for creating effects like explosions or sudden bursts of sparks.
Shape
The Shape module in Unity's particle system defines the area from which particles are emitted. Different shapes can be used to achieve various effects, such as:
- Point: Emits particles from a single point, ideal for effects like sparks or magic spells.
- Sphere: Emits particles from a spherical volume, suitable for smoke plumes or explosions.
- Cone: Emits particles in a cone shape, useful for gunfire or rocket thrusters.
- Box: Emits particles within a rectangular volume, perfect for rain or snow effects.
- Mesh: Emits particles from the surface of a 3D mesh, allowing for complex and customizable shapes.
Additional Options and Parameters:
Randomize Direction: Some emission shapes allow you to randomize the direction of emitted particles, adding variation and realism to the effect.
Spread: Controls the spread or divergence of emitted particles within the shape. Higher spread values result in particles being emitted in a wider area.
Controle Particles with Script
In the Start()
method, the Play()
method is called on the my_particles
ParticleSystem component, causing it to start emitting particles.
Immediately after calling Play()
, the Stop()
method is called on the same my_particles
ParticleSystem component, causing it to stop emitting particles.
This is the official documentation from unity about the particles system: Particle System
1. What is a particle system in Unity?
2. What property controls the number of particles emitted per second in Unity's particle system?
Thanks for your feedback!