Particle effect example - fire and smoke

This example shows a simple particle effect for imitating fire and smoke using two emitters and 3 modifiers in a single particlefx component.

Project files

Setup

The Particle Effect consists of two emitters: for fire and smoke. Each of them has tweaked properties. All combined creates a fire and smoke effect. There are also modifiers.

Both emitter use a simple radial gradient blob image from sprites.atlas. Fire emitter is in front, because its Z position is 0.1, while smoke is at Z position equal to 0.

There are two modifiers that affect both emitters:

Fire emitter has one additional modifier:

Fire properties

Changed properties (from default):

Additionally, the curves for Life Scale, Life Red, Life Green, and Life Alpha properties were adjusted:

Smoke properties

Smoke emitter has a smoke animation from sprites.atlas.

It has two modifiers:

Changed properties (from default):

Additionally, the curves for Life Scale, Life Red, Life Green, Life Alpha and Life Alpha properties were adjusted:

The collection contains just a single game object with “particles” particlefx component and the script.

Scripts

fire_and_smoke.script

function init(self)
	particlefx.play("#particles") -- <1>
end

--[[
1. Start playing the particle effect in component "particles" in this game object.
--]]