Answers for "how to ignore collisions of children of an object"

C#
0

how to ignore collisions of children of an object

public class IgnoreChildCollisions : MonoBehaviour
{
    //    I Manually populated this array
    public Collider2D[] children;


    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        foreach(Collider2D child in children)
        {
            foreach(Collider2D c in children)
            {
                Physics2D.IgnoreCollision(child, c);
            }
        }
    }
}
Posted by: Guest on April-21-2021

Code answers related to "how to ignore collisions of children of an object"

C# Answers by Framework

Browse Popular Code Answers by Language