- Home /
OnCollisionExit2D doesn't activate after layer change?
We're using layers in order to make it to jump through the underside of a platform and land on the upside of it with the player. However the new collision mask for that platform doesn't take effect instantly if you fall off the platform and the player collide with it from the side. Supposedly this is a known bug in Unity.
This is fixed by disabling and re-enabling the boxCollider2D on the platform. This causes some kind of bug where collisions with the platform doesn't send a OnCollisionExit2D message when the collision ends. This causes a problem with the players jump logic since it uses that function.
Is there any work around to this bug? We tried putting it on the player instead but that only made it worse. We also tried just deactivating the boxCollider2D instead of changing layers, but that doesn't work with the platforms design as it is now since it has different states.
Your answer
Follow this Question
Related Questions
using IsTouchingLayer without collision 0 Answers
Performance: How expensive are Trigger Collisions? How many collision layers should be used? 1 Answer
Collision Matrix not working as intended 1 Answer
Inexact rebound when colliding into corner of two walls. 0 Answers
Collisions layer is not appearing. 1 Answer