Been going around in circles with emitters recently and unable to come to a definitive answer. Case in point, I've a unit that creates an attached emitter like so. Saving it to a table "self.ThrasherFXBag" for later use...
table.insert(self.ThrasherFXBag, CreateAttachedEmitter(self, 'exhaust', self:GetArmy(), '/effects/emitters/missile_smoke_exhaust_02_emit.bp'):ScaleEmitter(0.5))
self.Trash:Add(self.ThrasherFXBag)
Later I want to destroy the emitter and call this function...
FXCleanUp = function(self, whocalled)
local myDebug = true
if myDebug or mainDebug then WARN('UEA0206 FX Clean Up: ', whocalled) end
--Destroy Afterburner FX
if self.ThrasherFXBag and table.getn(self.ThrasherFXBag) > 0 then
if myDebug or mainDebug then WARN('self.ThrasherFXBag > 0 ') end
for k, v in self.ThrasherFXBag do
if myDebug or mainDebug then WARN('Destroying v') end
v:Destroy()
end
end
if myDebug or mainDebug then WARN('self.ThrasherFXBag size after destroy: ', table.getn(self.ThrasherFXBag)) end
end,
My log is showing...
WARNING: UEA0206 FX Clean Up: Afterburner 1
WARNING: self.ThrasherFXBag > 0
WARNING: Destroying v
WARNING: self.ThrasherFXBag size after destroy: 1
So based on the log someone could assume that nothing is being destroyed?
or
Is the emitter being destroyed, but the table is not cleared after each instance is removed?
Side note: I've also notice that not all emitters are capable of be scaled. No idea why this is or what criteria determine this. By chance anyone know?
-Resin