Hi Guraoz,
Just wanted to share with you some issues / improvement I found while working with your Particle Decay setup.
- Issues with emitter’s scalability system :
I was using the particle decay setup for a infinite particle I sometime want to deactive from a blueprint. I’m also using visibility culling for this particle inside the emitter scalability. With both visibility culling and particle decay together, if you look away from your system, the emitter will go to sleep du to the scalability, then the particle decay script will see that as some kind of deactivation and will run as intended, the particle will be killed (if enabled), and when you look to your system again the sprite won’t show up anymore.
To handle this issue, I added another condition for the script to run
So now the script will not only look to current emitter & particle execution state, but will also look for the emitter execution state source. If the emitter was deactivated by the scalability of the emitter, it won’t run the particle decay script anymore, but if I deactivate the system by blueprint the source will be “owner” and then the script will run as intended.
- Custom decay triggering condition :
I also thought it could be usefull to be able to select a custom condition for the script to be triggered. I added a “Custom Condition” bool input parameter to be able to choose whatever reason you could think of to trigger some particle decay.
One obvious usage would be to be able to fade out particles instead of instantly killing them in some cases.
Let’s say you have some particle that you want to kill if they get too far away from the player. The obvious workflow would be to use a “Kill Particle” module, and fill the condition of the kill particle with a distance check between particle position and player position. It does work, but your particles will die instantly when it happens.
Instead of killing your particle, you could use the result of the distance check as a condition to trigger the particle decay and have a proper fading out animation.
Hope those feedback will be helpfull, and thanks again for the idea man, I’m using this on weekly basis now that I have it