Make particle emissions masks using abstract shapes in Godot 4

We can use emissions masks to create emissions shapes to spawn particles. This allows us to create custom areas for spawning particles. Useful for spawning inside rooms or in shapes like cones.

Particles in a cone shape

To do this we need a mask to generate. You can use any image that has transparent pixels so your sprites.

Cone shape

Here is a cone shape that we can use, sized 64×64.

Load emission mask

There we load it via the Load Emission Mask. Make sure the GPUParticles2D is selected.

Emission shape 3

Now we have the mask loaded and should be showing the projectiles in that area.

Particles in a cone shape

We can make the particles have specific shapes as well by using the texture to load a sprite. I needed to do this as well to get circle particles but you can use your own sprites.

Emission shape 5

Another example using a circle emission mask shape:

Emission shape 4