VFX in Unity: Getting Started
Learn how to create your own custom visual effects using Unity’s built-in Particle System. By Ken Lee.
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Contents
VFX in Unity: Getting Started
30 mins
- Getting Started
- Testing the VFX
- Setting up the Testing Environment
- Understanding Particle Effects’ Key Attributes
- Size
- Shape
- Color
- Timing
- Making a Projectile VFX
- Creating the Muzzle Effects
- Making the Base Muzzle Cone
- Defining the Particle’s Shape
- Changing the MuzzleCone’s Color and Timing
- Testing the Muzzle Effect
- Making the Muzzle Flash
- Making the Muzzle Sparks
- Making the Impact Effects
- Adding an Impact Glow
- Fixing the Glow Cut-Off Issue
- Testing the Impact Effect
- Understanding the Projectile Structure
- Making a Projectile Tail
- Adjusting the Tail’s Shape and Size
- Making the Tail Look Fiery
- Testing the Projectile Tail Effect
- Making a Fireball Projectile
- Setting up the Projectile Particles
- Making the Fireball Head
- Making the Primary Projectile Tail
- Improving the Fireball Tail
- Making the Secondary Projectile Tail
- Adding Projectile Sparks
- Where to Go From Here?
Improving the Fireball Tail
This looks pretty good, but it’s not perfect. You’ll further improve the shape of the tail by changing the following rendering settings:
- Rendered Mode: Stretched Billboard.
- Material: Flame Add.
- Length scale: 3.3.
- Pivot: 0.33.
Using Stretched Billboard helps turn the square texture into a long rectangle. It’s an excellent trick to represent particles that move very fast.
Next, adjust the color by modifying Color Over Lifetime to the familiar yellow/orange fire tone palette.
At this moment, your fireball is ready! You should feel the heat when it plays.
Making the Secondary Projectile Tail
Although the fireball effect works, you can still improve it. In this case, you’ll upgrade it by adding a secondary, darker flame tail to help it stand out from the original flame.
To add the darker flame, duplicate FlameTail and rename it DarkenFlame.
Select DarkenFlame and change Color Over Lifetime to a brown color palette. Then, under Renderer, change Material to Flame_AB
Instead of using yellow and orange, you use red and brown to mimic half-burned ash. Using an Alpha Blended material helps make the color more solid and dark.
Now, you need to change the Renderer’s Sorting Fudge properties from 0 to 5 so the DarkenFlame particles spawn behind the FlameTail.
Lastly, you’ll add some fire spark to decorate the flame!
Adding Projectile Sparks
Sparks enrich many different visual effects, including the muzzle VFX and the projectile tail you made earlier. For your fireball, you’ll try something new — sparks that generate continuously instead of just once.
First, select Fireball and make a new particle by right-clicking and selecting Effects ▸ Particle System. Rename the new particle system Sparks.
To give the particle system the right scale and shape, go to Main and change the following settings:
- Start Size: 0.05 – 0.1.
- Start Life Time: 0.1 – 0.4.
Then, under Shape, change the following settings:
- Rotation: Y:180.
- Angle: 10.
- Radius: 0.2.
The fire makes the sparks, so you want to give them a flame-like color. To do this, modify the Start Color to a light yellow shade, FFE981.
To improve the sparks, you’ll now make them thinner and give them some randomness. First, you’ll start by using the Renderer to stretch the particles by changing the following settings:
- Render Mode: Stretched Billboard.
- Length Scale: 7.
Under Main, change the Start Size to 0.01 – 0.05.
Finally, you’ll use the Noise module to add some randomness by changing these settings:
- Strength: 0.5.
- Frequent: 1.
Select Apply All in the Prefab menu and click Play to see the final result:
Congratulations on finishing the tutorial! At this point, you should have a solid understanding of the settings you need to create basic but beautiful VFX.
Where to Go From Here?
Now that you’ve finished the tutorial, you can download the completed project files using the Download Materials button at the top or bottom of this tutorial.
This tutorial only scratches the surface of VFX in Unity. Your next independent step is to immerse yourself in the artistic and technical side of things so you can create bigger and better effects!
On the art side, explore the particle effects in your favorite games or the works of great artists on platforms like ArtStation. Just search ‘VFX’ at www.artstation.com and you’ll be off and running. You can also read this great “League of Legends” VFX style guide made by Riot Games.
On the technical side, check out the Unity Shader Graph for building fancy materials and VFX Graph for building advanced effects:
I hope you enjoyed this tutorial! If you have any questions or comments, please join the forum discussion below.