Question by
OttoClausen · Sep 04, 2016 at 08:29 AM ·
childrendererobjectsonbecameinvisibleoff-screen
Can I use another objects renderer in OnBecameInvisible() ?
I am working on cleaning up objects that are no longer visible for the camera in my 2D platformer game. Some of my objects are nested though, for example a platform with multiple obstacles. The obstacles are child objects of the parent platform but the script with the OnBecameInvisible() function is on the platform and only checks if the platforms renderer is out of view.
Can I include the renderers attached to the child objects in OnBecameInvisible()? Or can anyone suggest another way of disabling objects that are no longer visible that is good for performance?
Thank you in advance :)
Comment