So as you can see in the photo there is a box collider as a trigger behind the camera. What im trying to do is use the box to cull gameObject behind the camera. When the gameObject such as a building enters the trigger it will disable the gameobject and when the gameObject exits the trigger the object will enable. But i’m not sure how to make this work.
Put this on the objects you want to do this to.
void OnTriggerEnter(Collider other) {
renderer.enabled = false;
}
void OnTriggerExit(Collider other) {
renderer.enabled = true;
}
you can also use this
I’ve found it to be quite useful when triggers are being annoying ![]()
