After the initial burst of fire, our explosion should turn into a dark smoke cloud.
That’s what we are going to create in this lesson.
Create a new Particles2D as a child of the Explosion node and name it SmokeCloudParticles2D. Place the SmokeCloudParticles2D above FireBurstParticles2D in the SceneTree, so the smoke appears behind the fire. Godot renders nodes in their tree order from top to bottom unless you change their Z Index.
Increase the emission Amount to 16
and the Lifetime property to 3.0
so the smoke slowly dissipates in the air.
Since the smoke follows the fire burst, we want it to start big already. Set both Preprocess and Explosiveness to 0.6
, to make the smoke cloud denser.
To ensure the particles move independently from the node, toggle off Local Coordinates.
Finally, we’re going to use the same texture we used in the fire particles. Assign puff.png to the smoke node’s Texture.
Let’s make the particles spread in all directions as we did with the fire burst.
Create a new ParticlesMaterial in the Material property and expand the resource.
Set the Direction > Spread property to 180
. To prevent the particles from falling set all values in the Gravity category to 0.0
. Expand the Initial Velocity category and set the Velocity to 80
so the particles move at a slow speed. Randomize the motion by setting Velocity Random to 0.6
.
Let’s increase the emission area to spread the puffs even more. Change the Emission Shape > Shape property from “Point” to “Sphere” and increase the Sphere Radius to 40
.
To make the cloud feel alive, let’s make the puffs rotate a bit. Set the Angular Velocity > Velocity to 40
.
As we did in the previous part, let’s also add damping to the particles so they slow down as they spread. Set Damping > Damping to 40
and the Damping Randomness to 0.5
.
We’ll also have each particle start with a random rotation. Set Angle > Angle to 360
and Angle Randomness to 1.0
. This will asign each particle a random rotation between 0 and 360 degrees.
As the cloud grows larger, it should decelerate and fade out.
Next, we need to make the cloud grow. Set Scale > Scale to 2.6
to increase the maximum size of each particle. To add some variation to their size, drag the Scale > Scale Random slider to about 0.5
.
Create a new “CurveTexture” in the Scale > Scale Curve property. We’re going to create a plateau-shaped curve. The particles will increase in size, maintain their final scale for a while, then shrink to about half their maximum scale.
To achieve this plateau shape, add a point at about 0.75
horizontally and 1.0
vertically. Drag the leftmost and the rightmost points to a value of 0.5
on the vertical axis. Then, select the leftmost point and drag its right handle upwards so the curve ramps up quickly.
Finally, to fade the smoke, create a new Gradient in the Color > Color Ramp property like we did in the previous chapter. The smoke cloud should go from a brownish-gray to a darker tone and quickly fade out.
In the next part we’re going to see how to create fire trails.