Unreal Engine 4 Particle Systems Tutorial

In this Unreal Engine 4 tutorial, you will learn how to create particle systems and update them using Blueprints. By Tommy Tran.

Leave a rating/review
Save for later
Share
You are currently viewing page 3 of 4 of this article. Click here to view the first page.

Creating a Burst

First, you will need to set the spawn rate to zero because you don’t want to use the default spawning behaviour. Select the Spawn module and set Spawn\Rate\Distribution\Constant to 0.

Unreal Engine 4 Particle Systems Tutorial

Next, you need to tell the emitter you want to create a burst. Scroll down to the Burst section and add a new entry to the Burst List. You can do this by clicking the + icon.

Unreal Engine 4 Particle Systems Tutorial

Each entry will contain three fields:

  1. Count: How many particles to spawn. Set this to 20.
  2. Count Low: If greater than or equal to 0, the amount of particles spawned will range from Count Low to Count. Leave this at -1.
  3. Time: When to spawn the particles. A value of 0 indicates the beginning of the emitter’s lifetime. A value of 1 indicates the end of the emitter’s lifetime. Leave this at 0.0.
Note: You can find the emitter’s duration in the Required module. It is listed as Emitter Duration under the Duration section.

Unreal Engine 4 Particle Systems Tutorial

This means the emitter will spawn 20 particles at the beginning of its life.

Unreal Engine 4 Particle Systems Tutorial

To make it look like an explosion, you need to set the velocity so that the particles move outwards.

Moving the Particles Outwards

Since this is a top-down game, you only need to specify the X and Y velocities. Select the Initial Velocity module and expand Start Velocity\Distribution. Set Max to (1000, 1000, 0) and Min to (-1000, -1000, 0).

Unreal Engine 4 Particle Systems Tutorial

By specifying a range that goes from negative to positive, the particles will move outwards from the emitter.

Unreal Engine 4 Particle Systems Tutorial

Next, you need to set the amount of times the emitter should loop.

Setting the Emitter Loops

By default, emitters will loop indefinitely. This is great for effects such as fire and smoke but a burst should only play once. To fix this, you need to tell the emitter to only loop once.

Select the Required module and then locate the Duration section. Set Emitter Loops to 1.

Unreal Engine 4 Particle Systems Tutorial

Now, it’s time to play the explosion when an enemy dies!

Spawning Particles on Enemy Death

Go back to the main editor and navigate to the Blueprints folder. Open BP_Enemy and then locate the OnDeath event.

To spawn a particle system, you can use a Spawn Emitter at Location node. Create one and connect it to Destroy Actor.

Unreal Engine 4 Particle Systems Tutorial

Next, set Emitter Template to PS_Explosion.

Unreal Engine 4 Particle Systems Tutorial

Finally, create a GetActorLocation and connect it to the Location pin.

Unreal Engine 4 Particle Systems Tutorial

Now, when an enemy dies, it will spawn an instance of PS_Explosion at the enemy’s location.

Click Compile and then go back to the main editor. Press Play and start shooting some baddies.

Unreal Engine 4 Particle Systems Tutorial

Look at all those explosions! Next, you’ll add some extra spice to them by making them the same color as the enemy.

Changing the Explosion Color to Enemy Color

To use the enemy’s color, you need a way to receive that information from Blueprints. Luckily, Cascade has a distribution type that allows for this.

Open PS_Explosion and select the Initial Color module. Set Start Color\Distribution to Distribution Vector Particle Parameter.

Unreal Engine 4 Particle Systems Tutorial

This will give you a parameter that you can set using Blueprints. Set the Parameter Name to PrimaryColor

Unreal Engine 4 Particle Systems Tutorial

For the explosion, you will use both of the enemy’s colors. To use the second color, you will need another emitter. Right-click an empty space on the emitter and select Emitter\Duplicate and Share Emitter. This will duplicate the emitter.

Unreal Engine 4 Particle Systems Tutorial

You’ll notice that each module now has a + sign next to it. By using Duplicate and Share Emitter instead of Duplicate, you have linked the modules instead of copying them. Any changes you make in one module will also happen in the same module of the other emitter. This is useful if you want to change properties across all emitters such as size.

The only module you will need to change is Initial Color. However, if you make a change, both emitters will receive the change. In this case, you do not want the modules to be linked as they need individual parameter names. The easiest way to unlink them is to delete the duplicated Initial Color module and create a new one.

Unreal Engine 4 Particle Systems Tutorial

Note: As of writing, there are no built-in methods to unlink modules.

Select the new Initial Color and set Start Color\Distribution to Distribution Vector Particle Parameter. Next, set Parameter Name to SecondaryColor.

Unreal Engine 4 Particle Systems Tutorial

At this point, the particle system is complete. Close PS_Explosion.

Next, you need to set the parameters using Blueprints.

Setting Particle Parameters Using Blueprints

Open BP_Enemy and then add the highlighted nodes after Spawn Emitter at Location:

Unreal Engine 4 Particle Systems Tutorial

This will allow you to set two parameters within PS_Explosion.

Now, you need to set the correct parameter names. Set Parameter Name for the first Set Color Parameter to PrimaryColor. Set Parameter Name for the second Set Color Parameter to SecondaryColor

Unreal Engine 4 Particle Systems Tutorial

Finally, you need to provide the colors. To make things easier, the colors have already been stored in the variables PrimaryColor and SecondaryColor. Connect each variable to their respective nodes like so:

Unreal Engine 4 Particle Systems Tutorial

Here is what you should end up with:

Unreal Engine 4 Particle Systems Tutorial

Let’s go over the order of events:

  1. When an enemy dies, it will spawn an instance of PS_Explosion at its location
  2. The PrimaryColor parameter of PS_Explosion will be set
  3. The SecondaryColor parameter of PS_Explosion will be set

Click Compile and then close BP_Enemy. Press Play and start shooting enemies to see the particle mayhem!

Unreal Engine 4 Particle Systems Tutorial

Look at all those juicy particles. See if you can add an explosion when the player dies!

[spoiler]

  1. Open BP_Player and locate the OnDeath event
  2. Add a Spawn Emitter at Location node to the Then 1 pin of Sequence. Set Emitter Template to PS_Explosion.
  3. Create a GetActorLocation and connect it to the Location pin of Spawn Emitter at Location
  4. Create a Set Color Parameter and connect it to Spawn Emitter at Location. Set Parameter Name to PrimaryColor and connect the PrimaryColor variable to Param.
  5. Create another Set Color Parameter and connect it to the first Set Color Parameter. Set Parameter Name to SecondaryColor and connect the SecondaryColor variable to Param.

Unreal Engine 4 Particle Systems Tutorial
[/spoiler]

Tommy Tran

Contributors

Tommy Tran

Author

Over 300 content creators. Join our team.