- Home /
Ignoring collisions between a layer and a single object
Hi everybody,
I'm having an issue with the physics between colliders. I've got a multiplayer game where player fight a mob of enemies. When a player gets hit, he flies away in theory ignoring the collisions with other enemies. All enemies are in the same layer, however I can't get it to ignore the enemy colliders. I can't make use of the physics layers because it is important that the other players still collide with enemies. I've tried implementing an OnColliderEnter -> Ignore collision but by that time the first contact has already been made, and the physics are responding to it. What I need is a way to say this collider ignore this layer. Does anyone have any suggestions?
Can you temporarily switch the player's collision layer to one that collides normally except for whatever layer the enemies are on?
Actually that solves the problem :) just for curiosity's sake though, is there a way to make one collider ignore a layer?
Your answer
Follow this Question
Related Questions
Layers are colliding even though they are set to ignore each other 1 Answer
Do you have to have a rigidbody component for collision detection? 1 Answer
Child object's collider (on a different layer) is interfering with parent Physics... 0 Answers
Disable/Enable Colliders 1 Answer
How do you enable the layer based collision matrix? 1 Answer