Ignoring collisions for specific objects only
My problem is the following:
I have one player object (tag: "Player"), multiple enemies (tag: "Enemy") and items (tag: "Item"). All of them have one BoxCollider2D each.
When the player touches an enemy, the player should become invincible for a moment and be able to "walk through" enemies during that time. For that, I could deactivate the player's BoxCollider2D temporarily. However, if I do that, the player can't pick up any items.
Is there a way to ignore collisions temporarily for a certain object type (here, objects with the "Enemy" tag)?
Your answer
Follow this Question
Related Questions
Audio Issues with Animation + Grounded 0 Answers
Script not working on Colliders 0 Answers
How to check if any/multiple 2D sprites neighbour/collide with eachother 0 Answers
Is there a way to prevent my character colliding with background? 0 Answers
How to create 2D terrain procedurally with 2D physics colliders ? 0 Answers