Unity2D/3D Particle System [Special Effects System] Create simple fireworks

First show the effect:

FireWork

In order to prepare for the study of Unity Particle System, I recommend that friends learn and practice according to the official manual. The following is the link to the official manual:

Particle System - Unity Manual

To make this simple firework, you don’t need to worry about downloading the material textures, just use the ones that come with the system.

First create a particle system in the Hierarchy panel

 We first make the guide for the fireworks and see the system shape template (defining the shape of the launch volume)

The default is a cone. We set both Angle and Radius to 0. At this time, you can see that all particles are emitted upward along a straight line. We only need one here. Select the Emission module. The properties in this module affect the rate of emission. and time.

Rate over Time: The number of particles emitted per time unit

Rate over Distance: The number of particles emitted per moving distance unit

We don't need particles to be generated continuously. Set the values ​​​​of both to 0, and then see the following explosion.

This is the introduction from the official documentation:

Click the + sign and set the value to the following:

At this time, only one particle is emitted along a straight line

We then add tails (Trails) to the particles. When the Trails module is checked, the following situation will occur:

 

This is a problem with the material, we see the Renderer module (rendering module)

Select Trail Material as the built-in transparent material

 

 At this point, the traction of the fireworks is basically completed. At the same time, the transparency of the trailing can be changed to achieve better effects.

Click Color over Lifetime. The bottom of the template that appears represents transparency and you can modify it yourself.

Next make fireworks

Create a new particle system in the Hierarchy panel

Set the Shape template to Circle and first rotate the particles 90 degrees so that they are perpendicular to our line of sight.

What we need here is for particles to explode outward near the circle

 The Radius Thickness here refers to the radius thickness. When it is 0, the range of particle generation is only the outline of the circle. When it is 1, the range of particle generation fills the entire circle.

In the same way, we don’t need particles to be generated all the time. In the Emission module

 We let him explode 50 at a time, and at the same time, the properties of the main module particles (only the life cycle and speed are adjusted here, you can adjust according to your own ideas)

This part is basically completed, now we are returning to the fireworks traction

Check the Subemitters module. Subemitters are additional particle emitters that are created at the particle's position during certain stages of its life cycle.

 The left side represents the conditions for triggering the sub-emitter

What we need is for the fireworks to explode after the fireworks disappear

Change the condition to Death, drag the fireworks effect from the Hierarchy panel to the selection box on the right, and an option will pop up.

 As a traction sub-launcher, fireworks need to be used as a traction sub-object.

The production of simple fireworks is completed! Of course, there are many parameters of special effects modules that can be adjusted by yourself to achieve better effects.

Guess you like

Origin blog.csdn.net/m0_64652083/article/details/132059976