- Home /
Why are particles disappearing when a completely distinct gameObject has its renderer disabled ?
So,
as the heading says I have some particles which will blink right out of existence when I set "renderer.enabled = false" on a completely different gameObject? the particles and the gameObject in question are both children of the same empty gameObject. (MovingBlobHolder)
the gameObject on which I turn off the renderer is "MovingBlob"
I access it thus -
blob[i] = Transform.Instantiate( Globals.g_main.movingBlobPrefab ) as GameObject;
blobObject[i] = blob[i].transform.FindChild("MovingBlob").gameObject;
where Globals.g_main.movingBlobPrefab refers to the MovingBlobHolder (parent) object...
to play the particles I do... blob[i].transform.FindChild("Particles").particleSystem.Play();
all of which works fine ... it's just that when i do gameObject.renderer.enabled = false from WITHIN A SCRIPT that is on the MovingBlob itself... the particles also completely vanish... which looks naff.
i've set their scale to 1,1,1 and the parent object's... didn't fix it for me. the parent object and the particles are still perfectly on screen...
any clues very gladly received ... :) thanks!
Answer by Paulius-Liekis · Aug 31, 2013 at 07:01 PM
It could be a bug in batching (try disabling batching - sometimes it solves problems like this).
Otherwise double check your code.