Creating fluid simulations
As we said, the best way to learn how to create particle systems is to keep looking for already-created particle systems and explore how people have used the various system settings to create completely different simulations.
In this section, we will learn how to create the following effects using particle systems:
- A waterfall effect
- A bonfire effect
Let’s start with the simplest one, the waterfall effect.
Creating a waterfall effect
In order to do this, follow these steps:
- Create a new particle system (GameObject | Effects | Particle System).
- Set Shape to Edge and its Radius to
5
in the Shape module. This will make the particles spawn along a line of emission:

Figure 11.22: Edge shape
- Set the Rate over Lifetime of the Emission module to
50
. - Set the Start Size of the Main module to
3
and the Start Lifetime to3
:

Figure 11.23: Main module settings
- Set the Gravity Modifier of the Main module to
0.5
. This will make the particles fall down:

Figure 11.24: Gravity Modifier in the Main module
- Use the same
Explosion
material we created previously for this system:

Figure 11.25: Explosion particle material
- Enable Color Over Lifetime and open the Gradient editor.
- Click the bottom-right marker, and this time you should see a color picker instead of an alpha slider. The top markers allow you to change the transparency over time, while the bottom ones change the color of the particles over time. Set a light blue color in this marker:

Figure 11.26: White to light blue gradient
As a challenge, I suggest you add a little particle system where this one ends to create some water splashes, simulating the water colliding with a lake at the bottom. Now we can add this particle system to one of the hills of our scene to decorate it, like in the following screenshot. I have adjusted the system a little bit to look better in this scenario. I challenge you to tweak it by yourself to make it look like this:

Figure 11.27: The waterfall particle system being applied to our current scene
Now, let’s create another effect: a bonfire.
Creating a bonfire effect
In order to create a bonfire, do the following:
- Create a particle system like we did in the section Creating a basic particle system with Shuriken, in GameObject | Effects | Particle System.
- Look for a Fire Particle Texture Sheet texture on the internet or the Asset Store. This kind of texture should look like a grid of different flame textures. The idea is to apply a flame animation to our particles swapping all those mini textures:

Figure 11.28: Particles texture sprite sheet
- Create a particle material that uses the Universal Render Pipeline/Particles/Unlit shader.
- Set the flames sprite sheet texture as the Base Map.
- Set the color at the right of the Base Map to white.
- Set this material as the particle material. Remember to set Surface Type to Transparent and Blending Mode to Additive:

Figure 11.29: A material with a particle sprite sheet
- Enable the Texture Sheet Animation module and set the Tiles property according to your fire sheet. In my case, I have a grid of 4x4 sprites, so I put
4
in X and4
in Y. After this, you should see the particles swapping textures:

Figure 11.30: Enabling Texture Sheet Animation
- Set Start Speed to
0
and Start Size to1.5
in the Main module. - Set Radius to
0.5
in Shape. - Create a second particle system and make it a child of the fire system:

Figure 11.31: Parenting particle systems
- Apply the Explosion material from the explosion example.
- Set Angle to
0
and Radius to0.5
in the Shape module.
The system should look like this:

Figure 11.32: Result of combining fire and smoke particle systems
As you can see, you can combine several particle systems to create a single effect. Take care when doing this because it’s easy to emit too many particles and affect the game’s performance. Particles are not cheap and may cause a reduction in the game’s FPS (Frames Per Second) if you are not cautious with them.
So far, we have explored one of the Unity systems that you can use to create these kinds of effects, and while this system is enough for most situations, Unity recently released a new one that can generate more complex effects, called Visual Effect Graph. Let’s see how to use it and see how it differs from Shuriken.