In this article, I explain how to create fireworks by Particle System in Unity. This time, we create skyrocket-style standard fireworks that spread out to round shape.
We create the fireworks shown above.
You can experience the sample space in STYLY GALLERY.
You can download the Unity project used in this article. Fireworks_Sample
Place Particle System
Select ‘Effect > Particle System’ and place it in the Scene. The particles move upward by default. We control their motion by various parameters to make them look like fireworks. I named it ‘burst’. Those particles are used to render fireworks spreading out to round shape.
Add spreading-out motion to particles
Firstly, just add a motion spreading out from the centre. Set ‘Rate over Time’ (The number of particles generated per second) to 0. Add a row by pressing the ‘+’ button under the ‘Bursts’ section. Set Time and Count to 0 and 250 respectively. As Cycle is set to 1, 250 particles are generated at time=0:00. Set Shape to ‘Sphere’, and Radius to 0.5. It completes the basis of the spreading-out motion of fireworks. Adjust the main parameters to add some randomness to particles’ motion. Click the ‘▼’ maker next to ‘Start Lifetime’ and select ‘Random Between Two Constants’. It generates a random value between two constants you set. Set ‘Start Speed’ to 25 and 30 with ‘Random Between Two Constants’ as well. Similarly, set ‘Start Size’ with the two constants, 0.3 and 0.6. In this state, the spreading motion doesn’t look natural so adjust the speed. We use ‘Limit Velocity over Lifetime’. Set ‘Speed’ to ‘Curve’ and select one from the preset curves shown at the bottom. Set ‘Dampen’ to 0.15. It now gives a motion of spreading-out fireworks. Let’s render a falling motion by adding a gravity effect. I set ‘Gravity Modifier’ to 0.2. Now the particles spread out to round shape, and then fall down, which look more realistic fireworks.
One of the beauties of fireworks is their colour. So let’s make them colourful. In the ‘Color over Lifetime’ section, adjust the colour gradation. To add the effect that particles diminish gradually, set the gradation so that Alpha reduces to zero gradually. Next, colour the particles. I set those particles so that they start with orange, then turns red-ish colour gradually. Next, create a particle in the state when it ascends in the air before the explosion. Create a new Particle System and set its parameters. To generate just one particle at 0:00 as a ‘Burst’ event, set ‘Rate over Time’ to 0. Set Shape to ‘Cone’, and Angle and Radius to 4 and 0.1 respectively. It completes the motion of an ascending particle.
Control Particles by Sub Emitters
Make the spreading-out firework appear at the same time that the ascending particle vanishes. In the Sub Emitters section, select ‘Death’ and ‘burst’. Press ‘Yes, Reparent’ when the window shown above popped up. It switch the particle into the spreading-out ones when the ascending one vanished, which makes the fireworks look more realistic. Colour the ascending particle. Set ‘Color over Lifetime’ with the gradation starting with orange-ish colour and turning into translucent gradually. In addition, make the particle trail smoke when ascending. Set the parameters as follows: Start Lifetime 0.1~0.7 Start Speed 0.05 Start Size 0.1~0.5 Emission/Rate over Time 180 Shape ‘Sphere’ Radius 0.01 Since the default Material looks too simple, create a new Material and assign it to the particle. Change Material from ‘Particle’ to ‘Additive’. In the Render section, replace Material with the new one just created. I prepared the image shown above as a Texture for the particle. By replacing the Texture, the rendering looks more realistic.
Add small fireworks
Duplicate the spreading-out particles (the ones with ‘burst’) created earlier. Adjust the parameters and put in the ‘Sub Emitters’ list. By varying the colour, we now completed rendering very colourful fireworks. In this article, I introduced how to make fireworks by Particle System in Unity. Although it’s hard to understand and command all parameters, it’s a powerful tool to render things well without special meshes or textures. How to upload assets from Unity to STYLY: Read this article.