VFX for 2D projects

Tutorial

Beginner

+0XP

10 mins

Unity Technologies

VFX for 2D projects

This tutorial guides you through applying your 3D VFX knowledge to 2D Unity projects.

1. Overview

You’ve made VFX for 3D projects, including fire effects, environmental weather effects (snow/rain), and burst particles. In this tutorial, you’ll explore a 2D version of the 3D scene with similar VFX implementation and you’ll see how that VFX functionality would be similar or different.

Fire pit at the center of rocky area with rain drops falling and splashing on the ground.


2. Experience the 2D_VFX scene

In this step, you'll open the CreativeCore_2D project and then explore the 2D VFX demo scene within it.


Instructions

To test out and explore the 2D VFX scene, follow these instructions:

1. Download and open the CreativeCore_2D project:

  • If you’ve already downloaded the CreativeCore_2D project in a previous unit, open it now using the Unity Hub.
  • If you haven’t downloaded it yet, you can download the project here and then open it using the Unity Hub.
  • When the project is open in the Unity Editor, verify you see a CreativeCore_2D folder within your Project window, containing several subfolders.

2. Open the CC_VFX_2D scene:

  • Go to Assets > CreativeCore_2D > Scenes, then open CC_VFX_2D_Scene.

3. Enter Play mode and take note of the VFX elements:

  • Enter Play mode.
  • Notice the following:
    • The fire particle effect, smoke, and fireflies look very similar to their 3D counterparts.
    • Press Spacebar to trigger the fire on/off, observing the smoke burst.
    • The rain appears to splash on the ground.
  • Exit Play mode when you are done.

3. Explore 2D vs 3D implementation

When implementing visual effects in Unity 2D projects, you'll find both similarities and key differences compared to 3D projects. For each of the similarities and differences listed below, explore the project to make sure you understand how each of the features were implemented in 2D.

What's the same?

Particle systems:

Unity's Built-in Particle System can be used in both 2D and 3D projects to create various effects like smoke, fire, and explosions. The core modules (Emission, Shape, Color over Lifetime, Size over Lifetime, etc.) function the same way.

  • Select one of the GameObjects with a Particle System component (the fire, the rising smoke, or the smoke puff).
  • Explore the enabled modules to see how the effect is configured.
Smoke Particle System selected showing the Particle System modules open in the Inspector window.

VFX Graph:

For more complex and optimized effects with millions of particles, VFX Graph can be utilized in 2D projects in the exact same way. In this project, the rain and its splashes are made with VFX Graphs.

  • Select either the VFX_Graph_RainDrops or the VFX_Graph_RainSplashes GameObject.
  • In the Visual Effect component, select the Edit button next to the Asset Template property to open the VFX Graph editor window.
  • Explore how the VFX Graph is configured.
The VFX_Graph_RainDrops is selected, highlighting all of the raindrops in the Scene view. The VFX Graph window is also open, showing a zoomed out view of the VFX Graph blocks.

What's different?

2D properties of Particle Systems

In the Main module, the Gravity Source property can be set to 3D Physics or 2D Physics. Using 2D is more optimized for 2D projects.

  • In the Hierarchy window, select the VFX_ParticleSystem_Smoke GameObject and locate the Gravity Source property in the Main module. Notice this property is set to 2D Physics.
Main Module of the Particle System component expanded to show that the Gravity Source is set to 2D Physics.

Also, in the Shape module, you have the option of using a 3D emitter shape like a Sphere or a Box, but you also have 2D emitter shapes like a Circle or Square. You used a 3D emitter in the Sprite Flight course, which worked well, but it’s more optimized to use a 2D emitter shape. You just need to make sure you orient the emitter correctly relative to the camera.

  • Select the VFX_ParticleSystem_Puff GameObject. In the Shape module, the Shape should be set to Circle (a 2D shape). Open the Shape property dropdown to explore the variety of 3D and 2D shapes.
Shape module expanded for a smoke puff particle system, showing the Shape property set to Circle.

4. Next steps

You now understand how to implement VFX in 3D projects and how that translates almost perfectly to the creation of 2D projects. You’re ready to apply these concepts to your own personal projects, be they 3D or 2D.

Complete this Tutorial