# What are the tradeoffs I should consider when choosing how to track whether a GameObject is out of bounds? (Unity 3D)

The obvious ways are to either:

• OnTriggerExit for a box collider which wraps the stage bounds
• OnTriggerEnter for 6 flat box colliders surrounding the stage

I suppose, to start, 6 flat boundaries allow me to differentiate between falling/moving out.

OnTriggerExit could also misfire if a GO is warping to another (disconnected) stage.

But flat boundaries allow for edge cases to occur where the GO moves too fast to trigger the volume, and seem more annoying to set up consistently.

Are there other performance advantages or setup challenges to either approach?

• It sounds like you understand the considerations that apply to each (though you can mitigate the risk of missing the outer bound boxes by just making them huge). Which set of pros/cons you prefer is really up to you. Dec 2 '21 at 3:41
• There is also another option: Make game objects themselves responsible for checking if they are out of bounds. This could be done by a "BoundChecker" component which checks its transform.position in Update and reacts if it's out of bounds. Dec 2 '21 at 9:38