OnTriggerEnter2D Doesn't fire after switching to IsTrigger on

Hi all,

So I have a simple rigidbody 2D with a box collider, sitting on top of another rigidbody 2D with a box collider.

I then switch the box underneath to IsTrigger, and the top box falls through as expected.

The only problem is that OnTriggerEnter2D or OnTriggerStay2D doesn’t fire. It only fires once the object is moved out of the bounds of the first object, then moved back in.

Does anyone know why this is, and a possible solution?


Likely your moving box is already penetrating the collider of the obstacle box when it starts.

Move it so its a bit above and see if the same thing happens.

So my super hacky solution was to add another collider component that isTrigger and make it slightly smaller than the actual collider. This then triggers as expected.