Sponsored By

Unity Particle Systems!

The sky's the limit when it comes to creative design for particle systems.

Trevor Robbins

December 4, 2023

4 Min Read

Intro

Recently, I have been working with a team developing a game entitled Conquering Ciros. This is a small indie project with fellow students at my college as part of our game development/design program. As one of five programmers, I have had the experience to work on many different systems within the game, and there is one thing that has been relevant in almost all my implementations of systems; particle systems. Particle systems in Unity are extremely diverse and offer great opportunities to spice up a game through the usage of technical art.

Usage

Within the context of this game I have created particle systems for various different usages. Many different usages of particle systems include death effects, enemy and player attacks, and livening up world space. Within the game I have created all of these. One of my favorite particle effects I have created has been a simple effect that has drops of blood falling from various branches on a tree within our game and then splattering once it reaches the point of blood puddles that are on the environment art. This is a really interesting showcase of the usage of particle systems because it shows that they can be used to simulate movement and animations simultaneously. While this could have been done with an animation itself, it would require work from our singular artist, so it helps take creative load off of them. Particle systems also do a much better job of simulating gravity than an animation would.

Another usage of particle systems that prove to be advantageous over using solely animations comes from a smoke effect I made to attach to the end of various attacks within the game. This particle system randomly selects frames from a spritesheet, which creates a much more diverse effect than cycling through the same animation every time it is used.

Implementation

Adding particle systems in Unity is genuinely quite simple. Unity has an inherent particle system class that can be added to empty game objects, and then the rest of the work comes from modifying behavior within the editor to get the desired effect that you want.

Basic Inspector Properties:

Duration: How long the particle system lasts, which is different than lifetime, this is important especially if you want your particle system to loop. If duration is greater than lifetime, it will have a period of nothing happening before looping.

Start lifetime: Also how long the particle system effect lasts, which actually dictates how long the particles are moving.

Start size: The size of each particle in the particle system.

Start speed: How fast the particles move.

It is important to note that each of these and all of the other inspector properties not mentioned can be completely randomized, so you can have many particle systems of the same type with completely different values for each.

Emission Properties:

Rate over time: How many particles will appear over a certain number of time in seconds.

Rate over distance: This dictates how many particles will appear as the particle system is moving in world space.

Bursts: Bursts are probability based outcomes that can randomly select a burst of particles over the duration of the effect.

Shape:

In this inspector tab you can specify the shape in which the particles emit from as well as the angle in which they emit.

Sub-Emitters:

Sub-emitters are used to specify particle systems that are activated through an activation event from the particle system itself. In the context of Conquering Ciros, I used a sub-emitter to play the blood splatter animation on the death of the drop of blood falling. This creates maximum accuracy in the effect, and I was also able to adjust the lifetime so it could fall different lengths before playing the animation. 

Colliders:

Particle systems in Unity support colliders, however in the version of Unity that we use, they do not really have functionality for being a trigger, which is what most projectiles in a 2D based game like ours are. To get around this, I had to create a layer mask that only interacted with the player layer for some of the boss attacks in the game that used particle systems.

Overview

The sky's the limit when it comes to creative design for particle systems. They truly are a technical artist's dream and have so much diverse functionality and are relatively simple to learn how to use. I highly recommend you attempt to add one to your game projects, it is sure to spice up the life of your game!

Read more about:

Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like