private void OnTriggerExit(Collider other) { // Physics.IgnoreCollision(this.GetComponent<Collider>(), other, false); if (other.gameObject == parent) { parent = null; } else if (other.GetComponent <GlueBall>() == otherGlueBall) { otherGlueBall = null; } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.GetComponent <Rigidbody>() != null) { if (parent == null) { parent = other.gameObject; pRB = parent.GetComponent <Rigidbody>(); } else if (otherGlueBall == null && other.gameObject.GetComponent <GlueBall>() != null) { otherGlueBall = other.gameObject.GetComponent <GlueBall>(); } } }