There may be differences between your version of Spark AR Studio and this tutorial because the product is currently in beta and we update it regularly.
In this guide you'll learn about inserting and editing particle systems.
You can use particle systems to create and move lots of objects at the same time, like confetti, fireflies or stars.
Physics can be applied to particles, simulating force and drag to emulate the effect of gravity.
Download the sample content to follow along.
To get started, open the unfinished project in the sample content folder. We've already imported the texture you'll need - it looks like a heart.
To add a particle system to your scene:
You'll see a stream of particles in the middle of the Viewport, and an object called emitter0 in the Scene Panel.
Next you'll use the options in the Inspector to make the particles look like falling hearts.
The material will define the appearance of the particles.
To create a material for the particle system:
The material will be listed under Materials in the assets panel. Select the material. You can rename it if you like, by right-clicking and selecting rename. For this tutorial, name the material particle_material.
Because the material is selected in the Assets Panel, you can see and edit its properties in the Inspector.
Start by changing the Shader Type, at the top of the Inspector. Set the Shader Type to Flat - to create a flat material.
A flat material won't give the object it's applied to realistic lighting and depth, which is fine for the particle system, because particles are 2D objects. For 3D objects, you'd generally use the Standard Shader, which incorporates lighting to provide objects with realistic depth, but has a higher impact on performance.
Add the heart texture to the material under Diffuse:
Now it's time to edit the particle system.
With particle systems, the best way to work out what looks best is to experiment. You can do this by adjusting the particle system's properties in the Inspector, and checking how it looks in the Viewport as you go.
The emitter is the source that the particles come from. Changing the Emitter type will change the shape of this source.
By default, the Type is set to Point, and as you can see the particles are moving outwards from a single point.
Edit this option to spread particles around your scene in different ways - for example, so they emit from a line shaped source, a plane shape or a ring shape.
For this effect, select Plane. The plane is a flat 3D object. Changing the emitter type to a plane means the particles will appear to be scattered across 3D space, giving the effect a sense of depth.
Edit Size to choose how big the emitter will be.
For this effect, change both values to 0.4, so the particles easily cover the width of what the camera can see.
You can tell what's in view of the camera by looking in the Simulator, or by clicking the Camera in the Scene Panel. The blue lines that will appeared in the Viewport represent the camera's view.
Select the particle system in the Scene Panel, to make a couple more changes.
Particles move upwards by default. Edit the rotation value under Transformations to change this. To make the particles move downwards, change the X value to 180.
The particles are currently emitting from halfway down the screen. Let's change the position, so they start at the top. It's easy to do this using the Manipulators at the top of the Viewport.
The first Manipulator lets you change an object's position. If you select it, you'll see arrows in the center of the Viewport. The green arrow runs along the Y axis. If you click the arrow and move it upwards, the particles will move upwards along the Y axis.
Move the particles, so they're positioned 0.25 on the Y axis. You can also set the position in the Inspector, by editing the Y value next to position.
The Birthrate value controls how many particles are emitted. There are 2 options here - a number on the left, and a percentage on the right. The first value here represents how many particles are being emitted per second. It's set to 20 per second by default. Adjust this value to create more particles. Try setting this to 40.
The percentage value on the right here, which you'll see for many of the other properties in this list - lets you add variation to particles. For example, if we set this value to 30%, the rate of emission will vary by plus or minus 30%. This will add some irregularity and make the emission feel more natural. So, set this value to 30%.
Change the Lifespan to set how long the particles appear for, in seconds.
It's a good idea to make sure the Lifespan is low enough to avoid particles appearing outside the camera's view - to help improve the performance of your effect. Like before, you can can check what the camera can see by selecting the Camera in the Scene Panel, and looking at the blue lines in the Viewport:
Working out the best setting for lifespan can take a bit of experimentation.
Make sure the particle system is selected in the Scene Panel. Try setting the Lifespan to 3. If you go back to the Camera in the Scene Panel, in the Viewport you can see the particles are disappearing when they're outside the camera's view - perfect:
Go back to the particle system. Next to Spray Angle in the Inspector, you can change the angle of the emitter. Change the first value here to 15 degrees, to add extra interest to the movement of the particles.
Edit this value to adjust the speed of the particles. Let's make some of them fall a little slower, by changing Speed to 0.075. Keep the 40% value as it is, so the speed isn't too uniform.
Setting Warmup will mean the particles start before the effect loads. This means they'll be visible in the camera when someone starts opens the effect. For this effect, check the box and set Warmup to 5.
This means the particles will start 5 seconds before the effect loads - which is a good length of time to make sure the particles are visible in the screen as soon as the effect is open.
You can change the Scale to make particles bigger or smaller.
For this effect, change the values to 0.215, and 20%. This will add some size variation to the particles.
This will make some of the particles twice as big as the others. This will apply a 0.2 times size variation to the particles, compared to before the 20% was set.
Setting Spin will make particles spin as they fall - this can make effects look more interesting and less uniform. Set Spin to 20 degrees.
Adjusting Tilt can also add interest to an effect, by changing the angle of particles as they fall. Change it to 20.
Checking the boxes next to Force and Drag makes particles look like they're falling more naturally - as if gravity was applied to them.
Check the box next to Force. You can set the particles to move with force in a certain direction, by adjusting the values next to Acceleration. For example, if you set acceleration to 1 along the X axis, the particles will accelerate very quickly along the X axis.
Finally, check the box next to Drag.
There are a couple of extra options it's worth pointing out while we're here. Increasing Linear drag will cause the particles to slow down their movement through space. Increasing Rotational drag will cause them to slow down their rotation. You can play around with these, but I'm going to leave them as they are for this effect.
You've now completed your first effect with particles!
In this tutorial, you've learned how to add a particle system to an effect.