Exemplo n.º 1
0
    protected void IgnoreRigidbodyCollisions(Rigidbody myBody, Rigidbody myHand) {
        Collider[] myBodyColliders = myBody.GetComponentsInChildren<Collider>();
        Collider[] myHandColliders = myHand.GetComponentsInChildren<Collider>();

        for (int i = 0; i < myBodyColliders.Length; i++) {
            for (int j = 0; j < myHandColliders.Length; j++) {
                Physics.IgnoreCollision(myBodyColliders[i], myHandColliders[j]);
            }
        }
    }