OnTriggerEnter fires but OnTriggerExit does not

Unity_CNJ7zOsM7Q.gif
“-1324” is green road, “-68908” is white road


This script is on both green road and white road

The green is generated road with mesh, collider, rigid body. When I move my cursor on the GIF one end of the road collides with another road (white) and OnTriggerEnter fires on both roads script, which is fine. However when green road leaves collider of white road theres is no OnTriggerExit on both of them! It fires though if I move the whole green road object. Why this happens and what could be a workaround?

Unity-2022-3-LTS

I know that triggers will lose their overlap state (they forget their knowledge of things that are inside them and due for OnTriggerStay/Exit calls) when anything significant changes about those things like a transform changes parents.

If you’re in the middle of generating the green mesh, I am going to take a guess that triggers also lose their overlap state when you modify the mesh that makes up the collider(s).

1 Like

Yeah I think you are right