Tutorial
Heading
Sep 26, 2023

Making Unity particles effect for Spatial

Add a musical notes and fireflies effects to your Spatial 3D worlds

Particle systems in video games and virtual worlds are essential tools for creating evocative visual effects. They allow you to add elements that enhance immersion in experiences, such as fire, smoke or magic spells, as well as anything else you can imagine.

Additionally, they can respond to player interaction and are used to tell stories and create specific environments. All in all, they are a powerful tool that adds detail and a touch of magic to our 3D creations.

In this guide, we will explain how to create a particle system in Spatial with its Unity SDK, a pack for creators that facilitates the development and creation of experiences. Specifically, we will talk about how to use a simple particle system without mesh and transition to one with mesh.

This procedure was used to add musical notes and fireflies effects to one of our most recent Spatial developments: Bora Boring, Shilly's tropical archipelago of urban islands.

Fireflies effect
Musical notes effect

Resources

How to create fireflies effect

First, create a particle system in the effects section and place it in the scene where desired. Remember to add the material with the effects you consider necessary; for example, I have created a material with a glowy effect. If you use the fireflies at night, the effect is more magical and beautiful.

Here are some options you can modify to achieve the effect of fireflies:

Start speed: set it to 0 to allow the particles to move around the area you have created without being affected by gravity. This will make them scatter and float in the air.

  • Emission ⮕ rate over time: adjust the number of particles you scatter at the same time to control the density of fireflies in the scene.

  • Shape:
    1. Shape:
    select the shape of your choice, although using a sphere is great for achieving the firefly effect.
    2. Radius: whatever you need.

Color over time: you can use a gradient to achieve variation in color over the lifespan of the particles.

Size over lifetime: use this option to control the particle size over time, using different types of curves for more precise adjustments.

Velocity over lifetime: if you require a bit more movement, you can activate this option. If you need a directional movement, you can modify the linear velocity in the x, y, & z axes.

  • Noise: adds motion to the particles. For the firefly effect, it's betterto have slowerer motion, so the strength and frequency should be set to low values.

How to create music notes effect

Preparation of the textures and meshes

For the musical notes, I created three different types. This isn't necessary, but afterward, you can randomize them so that way you won't always see the same one.

I made the musical notes in the same texture with alpha. Then, I created three planes in Maya with the three different notes and exported them to Unity with the correct axis. Remember to create the material for the notes and set the material blending mode to "alpha".

There are some particle system options that change from fireflies to musical notes. For example, the first part in the music notes is not the same that for the fireflies.

Configuration of the particles

  • Start speed: set it to 10 to give the particles some movement around the area without scattering too much.
  • Start size: adjust the size of the particle along the animation.
  • Gravity modifier: you can set it to -1 if you want the particles to move upward,or 1 if you want them to move in the direction of gravity.
  • Simulation speed: control the speed of the particles from here. I used 0.06 for a slow speed, allowing the notes to be seen clearly.

The next step is very important: select the renderer option to randomize the different notes.

  • Render mode: I have selected "mesh" because I created a plane for the particles, but you can choose whatever mode you need
  • Mesh distribution: I have selected "non-uniform random" in this case to make it look more organic.
  • Meshes: you must click on "➕" button as many times as you need. In this case, three times because I created three different musical notes. In each section, you have to select the mesh corresponding to the plane.
  • Material: apply the material of the music notes to the particles.

Important

One problem I encontered was that the particles would pass through the building and get lost in the sky. To solve this problem, I went to "lifetime by emitter speed" and selected it. In "multiplier", I chose "curve".

Further down, there is a screen that says "particle system curves". In the different types of curves, I selected the one that is completely straight line, the first one. Once it was created, I selected the entire line and lowered it until I achieved the desired result. In my case, I wanted the particles to disappear before reaching the ceiling.

The image on the left side is how it looks before apply the lifetime by emitter speed, and on the right side, it is after.

Before lifetime emitter speed

After lifetime emitter speed

Beautiful details to your 3D worlds

With the particle system, you can create a wide variety of things. If you stop and try each option, you are sure to make many beautiful things.

Here is a little guide on how to start using particles with or without mesh and how to get straight to the most important things without getting lost!

Art
Unity
Spatial
Blender
Maya
Isabel Peirona
Environment Artist

Passionate about video games and art

Tutorial
How to import Decentraland SkyboxEditor into Unity
Tutorial
Doing a MANA transaction in a Decentraland scene
Tutorial
Canvas (2D UI) Manager in Decentraland