【Unity Tutorial】Particle System

Particle system is a Unity function used to create effects such as sparks and flames in a scene.

By using 3D models, landscapes, and animations, creators can create almost anything with Unity, but by using the particle system, creators can express their creativity even further.

In this article, I am going to introduce the basics of the particle system, and a tutorial of how to install a particle package and use it.

Add a particle system

Select 「Game Object」→「Effects」→「Particle System」 from the menu bar.

Adding a particle system

A animation like a white sphere will become added to the scene. This is a particle.

Check the scene

Preview Panel

Select Particle System in the Hierarchy window, and a window named ‘Particle Effect’ will appear at the bottom right of the scene. This is called a preview panel.

Preview Panel

Details of the particle is shown in the preview panel.

Pause The animation will pause by clicking it.
Restart The animation will restart by clicking it.
Stop The animation will disappear by clicking it.
Playback Speed This is the playback speed of the animation. You can edit it by changing the number, or by moving the arrow on the right.
Playback Time This shows how much time has passed from the start of the animation.

Other information isn’t that important now, so you can put those aside for now.

Particle Transform

You can move, rotate, zoom in and out particles just like 3D models.

You can set where the sphere appears, or change the effect so that the sphere drops from the sky, as in the image below.

Fall from above effect

Change settings in the Particle Inspector

There is a Inspector window for particles, just like 3D models, and you can edit settings.

Particle system Inspector

The items vary according to the particle type, but I will introduce important items and common items.

Duration

Sets the time that the particle is visible.

If you set the loop OFF, the animation will end after the duration time pasts.

If you check the loop option, the duration will become the time for 1 cycle of the animation.

Looping

This is the setting for whether the animation loops or not. If you set this option, the animation will loop.

Prewarm

If you set this option, the animation starts immediately.

Start Delay

This is the time until the animation starts. If you set this option, the animation will be start after the delay time.

※Cannot be active if Prewarm is checked.

Start Lifetime

This sets how long the particle is visible.

If you set the number larger, each particle will be displayed for a longer amount of time.

Start Speed

This sets the display speed of the particle.

Start Size

This changes the size of each particle. If you set the number larger the particles will become larger.

Start Rotation

This sets the direction of the particle when it appears.

The example particle is a sphere, so this option doesn’t matter, but you may use this option when you are dealing with a particle with a different shape, or when applying materials.

Start Color

Sets the particle color. If you click the white long rectangle, the color picker will appear, and if you select a color, the particle will become that color.

Changing the Start Color to red

Gravity Multiplier

Applies gravity to the particle.

The default is 0, and as you make the number larger, the gravity applied will become larger.

Max Particles

Sets the max number of particles that appears within the screen.

If the number of the particles reaches this number, no more particles will appear.

If the number of particles decreases, new particles will be created.

Particle number transform equation

There are many items where you can change the number to change it, such as speed or size, but the number is fixed by default.

But you can change this so for example, the particle speed will gradually increase.

If you click the ▼ mark on the right of the number, a menu as in the image below will appear.

Particle number transform equation

Each element’s description is as below.

Constant The default setting, meaning a fixed number.
Curve You can draw a graph, and the number changes according to the graph.
Random Between Two Constants You select 2 numbers, and a random number between those 2 will be selected.
Random Between Two Curves You draw 2 graphs, and a number between the 2 will be selected randomly

How to create a Curve graph

If you select Curve or Random Between Two Curves, a graph as below will appear.

Particle System Curves

The left edge of the red line is the start position, and the right edge is the end position.

You can click, drag and drop a point on the red line, and move the line to form a graph.

Creating a curve

There are many sample curves shown below the graph, and if you click one, the curve will become applied to the graph.

Default curves

That will be all for the basic settings for particles.

Particle package

So, we have learned how to set particles, but it is difficult to create an animation we like just by creating a sphere.

But there are many particles in Unity which we can use.

Let’s import a particle package and create a particle in our scene.

Select 「Assets」→「Import Package」→「ParticleSystems」from the menu bar.

Select「ParticleSystems」

A package with a list of particles will appear, so please import it.

Importing a Particle package

Open 「Standard Assets」→「ParticleSystems」→「Prefabs」 from the Assets folder, and you can find a list of the imported prefabs.

Particle list

You can use a Prefab by dragging and dropping it into a Scene.

Adding a Prefab to a Scene

Please try out a prefab of your choice, and run the scene.

Fire Particle

We have successfully added a fire particle to a scene.

As in this tutorial, by using a particle package, creators can easily add animations of their choice to a scene. I hope you try out animations you like.