There is an old problem with Shuriken where the whole particle system gets culled when its center is off screen. There are also some suggested workarounds to be found, but none of them work for me. First let me clarify that there seems to be two possible causes for this problem. One has to do with scaling, and I’ve read some people who fixed it by setting the scale of their Shuriken transform to (1,1,1), others who have added a sub-emitter and got it to work. In my case, I believe the problem is a different one, and the above fixes didn’t work. I tried to pinpoint the problem, and here is what I found:
When using SetParticles() to set all the sizes, positions, etc from a script, the renderer.bounds property has Extends(0,0,0) afterwards, which explains why the whole system will be culled when its center is out of view.
A standard, non-scripted Shuriken will recalculate its bounds constantly while playing and will account for all the individual particles, thus still rendering when any are in view.
Now I wonder if anyone knows how exactly these bounds are calculated - maybe I need to script-set some other property of the particles or the system so it can calculate the bounds correctly? Or maybe I can force the Shuriken or its renderer to recalculate the bounds after calling SetParticles()?
[edit] If there is a way to call ParticleSystem.Play() without overwriting my script-set particle data, I assume that might help as well, as I believe the reason it does not update its bounds might be that it has to be stopped or paused in order for the scripted data to take effect.
[edit] I also tried giving the transform a mesh renderer and -filter in hopes there would be one bounding box per transform, but that didn’t do it either. So there seems to be no way to influence renderer bounds and shuriken culling at all? Can someone confirm that?
[edit] I just read, in an answer to this post, that the particle system “uses a single mesh”. Is there a way to access that mesh? When/how is it created? I’m sorry if I ask too many questions in one post, but an answer to any of them would enable me to at least try some more things to get it to work. So they’re all pointing to the same problem, I hope that’s fine. If there’s any way to improve my question please let me know - I’ve been fighting this problem on and off for years now.
The bug has been known for a while, I think when I first encountered it in 2012, it was already filed - at least some form of it.
– coding_crow