- Home /
Question by
flyingtomohawk · Jun 04, 2015 at 02:19 PM ·
2dignorecollision
How to ignore multiple colliders in IgnoreCollision
I have one game object with one collider, then another with 3 colliders(1 box and 2 circle), I use ignore collisions on both but only the box collider in the 3 collider game object is ignored, when I want all colliders in the gameobject to be ignored. Here's the code I use.
if (platBounds.Intersects(gcGO.GetComponent<Collider2D>().bounds))
{
Debug.Log(1);
Physics2D.IgnoreCollision(mainGO.GetComponent<Collider2D>(), col.gameObject.GetComponent<Collider2D>(), false);
}
else
{
Debug.Log(2);
Physics2D.IgnoreCollision(mainGO.GetComponent<Collider2D>(), col.gameObject.GetComponent<Collider2D>(), true);
}
any idea what I'm doing wrong.
Comment
Your answer
Follow this Question
Related Questions
Ignore collision 1 Answer
[2D] Is it possible to un-ignore collisions between colliders? 1 Answer
2D Animation does not start 1 Answer
IgnoreCollision doesnt work? 0 Answers