- Home /
Is there any way to disable Box collider 2d collision?
I am working on a 2D game which has a multi level map, and i want to track when the player cross the start line, so i give it a collider and i made it height up to the top of the map, so the player cant jump thrugh it. The idea was that i check when the player on thouch this collider and that would mean he crossed the start line.
Something like this:
Is there any way to disable collision with this collider, ot a better way or component to do it with maybe ?
Answer by unity_ek98vnTRplGj8Q · Jan 14, 2020 at 09:10 PM
Check the "Is Trigger" box on your box collider, then you can use the OnTriggerEnter2D function to see when the collision happens without the collider actually affecting the physics of you game and stopping your character's movement
If u check the Is trigger box, it let's me in from one side but for some reason it still dosn't let my characters' colliders through.
It's working now, but i had to give it to an empty gameObject, without the sprite renderer.