- Home /
Is there a way for 2D Box Colliders to ignore another?
I am creating a basic 2D jumping/flying side scroller thing which has objects moving through the air and get destroyed by a collider behind the player, the problem begins when I have the flight part since the colliders at the roof of the game are meant to keep the players inside yet they also destroy the objects before they enter which is not what I want. Any Ideas would be appreciated! Thanks
Answer by ijela · Nov 25, 2021 at 10:45 AM
@CakeTinn Edit > Project Settings > Physics 2D > Layer Collision Matrix there you can check off layers you don't want to collide with each-other. So change the "roof" Layer to a different one that collides with player only and make another layer for the objects that ignores the objects moving through the air.
Answer by unity_ka6jgzfPPmtNCw · Nov 25, 2021 at 10:24 AM
What you want is to set up the Physics collision Matrix. Take a look at this link:
Answer by logicandchaos · Nov 25, 2021 at 10:34 AM
Yes, you can put them on different layers and use the collision matrix in the project settings.
Your answer
Follow this Question
Related Questions
Problem with method Collider2D.isTouchingLayers() 4 Answers
How to select the trigger layer on a Box Collider 2D 2 Answers
making a 2d maze game 2 Answers
2DColliders going through eachother 1 Answer
Box Collider 2d Not Colliding 0 Answers