private void OnCollisionEnter(Collision collision) { InteractiveObjectController otherObject = collision.gameObject.GetComponent <InteractiveObjectController>(); if (otherObject && otherObject.attached) { AttachmentPointController otherAttachment = otherObject.parentAttachmentPoint; otherObject.Detach(); otherAttachment.Deactivate(); } }
private void OnTriggerEnter(Collider other) { InteractiveObjectController otherObject = other.GetComponent <InteractiveObjectController>(); if (otherObject && otherObject.attached && otherObject.breakMomentum <= GetMomentum()) { AttachmentPointController otherAttachment = otherObject.parentAttachmentPoint; otherObject.Detach(); otherAttachment.Deactivate(); } }