PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

Enabled

Smoke

bool

The Enabled property, much like ParticleEmitter/Enabled, determines whether smoke particles are emit. Any particles already emit will continue to render until their lifetime expires. This property is useful for keeping pre-made smoke effects off until they are needed later. Since smoke particles are destroyed when the Smoke object’s Instance/Parent is set to nil, this property is useful in allowing existing particles the opportunity to expire before destroying the Fire object altogether. See the function below.

local Debris = game:GetService("Debris")
local part = script.Parent
function stopSmoke(smoke)
	smoke.Enabled = false -- No more new particles
	Debris:AddItem(smoke, 10) -- Remove the object after a delay (after existing particles have expired)
end
stopSmoke(part.Smoke)


Code Samples


Add Smoke to All Fire

This code sample adds a Smoke object to every Fire object in the Workspace. It does this by using a recursive search.