2D Butterflies using the unity particle system

The unity particle system is a godsent! It can be easily used to create a variety of different effects. In this tutorial Ill go through how to make butterflies using the texture animation.

You can see this effect in my game Super Eyebrow princess.



Lets start the tutorial


To start off, you'll need the butterfly sprites. I made mine in Aseprite.

2D Butterflies using the unity particle system tutorial image - bsesp

Export it as a spritesheet.

2D Butterflies using the unity particle system tutorial image - sp

If youre too lazy you can us mine. Just download this.

2D Butterflies using the unity particle system tutorial image - butterfly

Now open up a unity project and import the spritesheet.

To get the sprites ready to use click on the spritesheet.

Change spritemode to multiple and filter mode to point. Click apply.

2D Butterflies using the unity particle system tutorial image - sprite

Now click on the sprite editor button.

Then slice the sprite sheet using the grid by cell size (32 by 32 pixels in my case). Click apply.

Click apply. Now the individual sprites are ready to be applied to the particle system

2D Butterflies using the unity particle system tutorial image - slice

Open up your scene and create a new particle system.

2D Butterflies using the unity particle system tutorial image - create

This is what the effect looks like.

2D Butterflies using the unity particle system tutorial image - 1

Change the shape to a box and increase the scale to x = 10, y = 10, z = 10

2D Butterflies using the unity particle system tutorial image - box

Change Max particles to 10

Change Start speed to 0

2D Butterflies using the unity particle system tutorial image - max

The particles will now look like this.

2D Butterflies using the unity particle system tutorial image - 2

Lets finally make the particles look like butterflies.

We do this using the particle systems texture sheet animation

Check mark the texture sheet animation.

Change mode to sprites

Add all the butterfly sprites from the sheet in the correct order so they play from the first frame to the last and then back to the first.

Change time mode to FPS.

And make FPS to around 10-15.

2D Butterflies using the unity particle system tutorial image - tex

You can now see butterflies instead of the white particles.

2D Butterflies using the unity particle system tutorial image - 3

To make them move around, check mark noise from the particle system

2D Butterflies using the unity particle system tutorial image - noise

Now the effect finally looks a bit natural.

2D Butterflies using the unity particle system tutorial image - 4

The effect is mostly done. But you should increase the lifetime to a larger number and add some color to the butterflies by changing the start color.

2D Butterflies using the unity particle system tutorial image - color

2D Butterflies using the unity particle system tutorial image - 5

Also by turning on the collision, the butterflies will interact with the objects in its surroundings.

2D Butterflies using the unity particle system tutorial image - coll

So The princess can interact with the butterflies in my game. This makes the effect feel much more real than just uninterctable background stuff.


And thats pretty much it for the tutorial. Hope you learnt something new. Feel free to recreate this effect in your games!