- Home /
Jump through a Collider
Imagine Mario bros, when he jumps from the ground to the upper block platform. He jumps through it, but then, he lands on it. That's what I need.
Both of my elements (the character and the platform) have a BoxCollider2D attached, so when I try to jump from bellow, the character just hits the platform.
How can I achieve that?
Answer by MelvMay · Mar 22, 2015 at 03:52 PM
If you're using Unity 5 then you can use the PlatformEffector2D component which provides the ability of one-way collisions.
Answer by Team_26 · Mar 21, 2015 at 08:10 PM
You can check if your character is under platform when it's jumping. If yes, disable the platform collider.
Answer by DarkSlash · Mar 22, 2015 at 04:28 PM
Im using Unity 4.6, so I deactivated the collider when Im below the platform until I get above. Not the most elegant solution but it worked.
Your answer
Follow this Question
Related Questions
How do I detect which collider is being collided with? 0 Answers
Weird ContactPoint2D on two BoxCollider2D collision 0 Answers
Detecting empty collider 1 Answer
Unexpected token: collider? 1 Answer