Can we please get CallbacksOnDisable for 3D physics?

So for those not familiar with this behavior. Unity doesn’t send an OnCollisionExit or OnTriggerExit message when objects are disabled or destroyed. 2D physics has a fix for this in the form of a lovely config option. Physics2D.callbacksOnDisable. This means you can do one of the most basic things that triggers are designed to do. Keep track of what is overlapping them.

Currently in 3D you basically have to recreate the whole OnEnter OnExit chain plus a bunch of state mimicking nonesense. Keeping track of when objects get disabled, when their colliders get disabled, when their collision state changes, etc… Please. For my sanity. Don’t make anybody else have to hack around this problem like I’ve had to do… =<

Bonus points: An equivalent to physics2D’s OverlapCollider function for getting all overlapping colliders would be super nice and remove the need for a custom script.

Use cases: I work a lot in VR, a huge amount of VR design is trying to figure out what your hovering over with your hand, did that ball you threw land in the basket, are there any items in this pot, is there anything the torch should light on fire, etc… But this is also super useful in non VR projects, is the player in this zone, what enemies are in this zone around the player. what is near this spawn point, etc… These all become a lot more expensive and complex when you’re forced to use collision queries instead.

5 Likes