I have a weird problem to debug, I’m creating through a factory a GO containing an particlefx and a following script:
function init(self)
particlefx.play("#fx")
end
function final(self)
particlefx.stop("#fx")
print("Deleted")
end
Then, when I delete this object I assume the particlefx should stop playing, but it isn’t, even when the “Deleted” is printed Where could I made a mistake?
I couldn’t reproduced it in a new project, so it’s probably something rooted deeper in my project. I shared it with you, if you’ll have a time and will look at it I’ll be really grateful!
I made a small workaround - I created a variable in a lua module that is initially set to false and when I want to destroy this particle, instead of sending a message to its script or deleting its GO, I set that value to true, and in update function of GO having this particlefx I’m deleting it when this value is true. I still can’t figure out why the particlefx.stop() doesn’t work, when I’m sending a message to stop it or deleting its GO and in final there is stop()…
function update(self, dt)
if stats.destroy_charger then
particlefx.stop("#fx")
go.delete()
end
end