Game Development tutorials
Game Development  journey
Beginner "how to" tutorials , programming, software usage,  artwork, news  and more
For TIPS and SHORT TUTORIALS
 FOLLOW 
100+

How to use Particles2D in Godot

Posted by Vix Mark on December 18No Comments

Particles2D is a Particles Generator in Godot Engine. It's used to make all kinds of things where certain amount of elements need to be generated per given time frame at the defined position in Local or Global coordinates, have needed behavior and the level of its randomness.

Particles Generator can make things much easier when creating for example a snowfall, raining, fire burning, leaves falling, fogs as well as some nice effects in a game or as I'm going to demonstrate in this article - an Exhaust System.

Creating and setting up a new Particles2D Node

A new Particles2D Object is created just in a few clicks with "Create New Node" UI window. As with all the other Nodes in Godot to add it to a project scene press '+' button in the Scene Tab or use CTRL+A combination.

Adding new Node

A new window is going to pop up containing the list of available Nodes. The Search helps find the right one quicker so start typing "Particles2D" and you'll be navigated to the right spot within the list. Add Particles2D to the project Scene by clicking "Create" button.

Creating Particles2D Object

Nodes can also be added to a scene with GDScript:

# Make a new Particles2D Node and assign it to particles variable 
var particles = Particles2D.new()

# Adding particles as a child of the scene this script is connected to 
func _ready():
   add_child(particles)
   # Turning on particles emitting
   particles.emitting = true

Particles2D settings

In order for Particles2D to work a new Particles Material has to be created under the Process Material property in the Inspector Tab.

Choose the Node in the Scene Tab, than go to the Inspector Tab and click on Process Material - create a new Particles Material. Once it's done click on the Particles Material for its properties to unfold.

Particles2D basic properties

The amount of options and settings the Particles Material is equipped with is huge and going through all of them in details would be a rather time-consuming process. Try changing properties values and observe particles behavior to have a better understanding of what they do. Many of the settings are quite self-explanatory but you always have an option to hover the mouse cursor over any property's name for its description to pop up.

Working on a small project I made an acid green exhaust like flames using white circle shaped texture for a Player. It looks like this ( though the scene looks much better in the Editor):

The final result of the Cartoon Plane project

The cartoon plane above with the greenish exhaust has a circle shaped particles emitted. Circles look smoother comparing to the default squares. I used an 8*8 px image of a white circle as texture in Particles2D properties. Place this image in the project folder then drag and drop it from there to Texture property located in Textures section of the Inspector Tab

Here's my settings for Particles2D:

Material properties 1.1
Material properties 1.2
Material properties 1.3

I've highlighted the properties I used but bare in mind that you might want to adjust them for your needs. As I was building a high velocity imitating thrusting system it was essential for particles to have:

  • a high initial velocity
  • relatively short lifespan
  • different color depending on their position while moving
  • loss in size toward the end of the lifespan.

By default particles are affected by Gravity. Applied gravity is easy to configure by changing gravity vector values or setting (0, 0, 0) in Gravity Section of the Settings to get rid of any gravity completely. The flames didn't need gravity so I change the default vector to all zeros.

Adjust particles local position and rotation and if particles effect you are building has to be positioned behind its Parent - check Show Under The Parent checkbox under CanvasItem->Visibility.

A Child Node in Godot is usually shown on top of its Parent Node but for the cases like this one there's always an option for all CanvasItem Objects.

Position and Rotation
Show Behind Parent checked

The flames now look like they are coming from inside this cartoon plane:

You can experiment with different properties of Particles2D adjusting them to suit your requirements.

How to use Sprite Sheet with Particles2D in Godot Engine

There's another useful feature which can come in handy when making a multiple explosions scene for example or anything in Godot where each instanced particle will be animated independently with a sprite sheet . You just set random spawning within defined area and get nice multiple explosions.

Using Sprite sheet with Particles2D making random explosions

Drag and drop a sprite sheet in the texture property of Texture Section. Then scroll down to Material Section in Inspector Tab and add a new CanvasItemMaterial. Click on it for its properties to unfold. Check Particles Animation checkbox, set your Sprite Sheet's horizontal and vertical frame counts with Particles Anim H Frames and Particles Anim V Frames.

CanvasItemMaterial properties

Remember to add a new ParticlesMaterial beforehand and set up its properties for animation to function the way it's supposed to.

That's it for today. You can join me on Instagram @game_dev.fcups where I also share Godot tips, drawings and experiments results that might be useful for those who's just starting learning game development.

Share this
Pin it
Conversation
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
©2026 GamaDevFcups - how to make Indie Games.

Game Development: Godot Engine, Krita, Blender, programming, tutorials

GameDevFcups

Desidned and built by VixStudio
 | 
VixMark@protonmail.com
pointer-down
0
Would love your thoughts, please comment.x
()
x