I know that sounds odd as a deactivated gameObject will never be visible… but I have the following script that works great for deactivating my offscreen trees… but how do I go about getting them to activate again? Obviously this code won’t work as once deactivated, they can never become visible again. I also tried with renderer.enabled etc but same issues:
function OnBecameVisible()
{
// gameObject.active = true;
gameObject.renderer.enabled = true;
}
function OnBecameInvisible()
{
// gameObject.active = false;
gameObject.renderer.enabled = false;
}