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().bounds))
{
Debug.Log(1);
Physics2D.IgnoreCollision(mainGO.GetComponent(), col.gameObject.GetComponent(), false);
}
else
{
Debug.Log(2);
Physics2D.IgnoreCollision(mainGO.GetComponent(), col.gameObject.GetComponent(), true);
}
any idea what I'm doing wrong.
↧