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 startoff, youll need the butterfly sprites. I made mine in Aesprite.

Image

Export it as a spritesheet.

Image

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

Image

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.

Image

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

Image

Open up your scene and create a new particle system.

Image

This is what the effect looks like.

Image

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

Image

Change Max particles to 10

Change Start speed to 0

Image

The particles will now look like this.

Image

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.

Image

You can now see butterflies instead of the white particles.

Image

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

Image

Now the effect finally looks a bit natural.

Image

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.

Image

Image

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

Image

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!