- Home /
Ignore collision in specific circumstances while still using it as a trigger.
I am making a 2D platformer type of game. In this platformer there are both the player and "enemies". The problem arises because: I need both enemies and players to collide with the ground so they don't fall through it. I need to detect when a player collides with an enemy so i can register damage. I need the player to be able to walk through an enemy. Having colliders on the feet is not an option because the player may interact with it. What is the best way to approach this kind of specific collision detection?
Answer by Fariborzzn · Dec 23, 2019 at 07:55 AM
You could use the Layer Collision Matrix from Edit > Project Settings > Physics 2D 1-Assign Your GameObjects Specific Layers From There Just specify How this layers Response To Eachother.
Your answer
![](https://koobas.hobune.stream/wayback/20220612220534im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Load Scene on Either Edge of Camera Collision 2 Answers
Why is my character not colliding with other objects. 3 Answers
Generate Tiles Programatically Over Player Position? 0 Answers
Unity 2D - MoveTowards position not updating, not recgonizing new position 1 Answer
Find out that player is not grounded 2 Answers