public void ForceDetach() { for (int i = 0; i < bonesCount; i++) { RagdollPhysics.DetachRigidbody(allElements[i].rigidbody, null, true); } }
public void Detach() { grabPoint.Detach(); for (int x = 0; x < physicsHit.hitElements.Count; x++) { RagdollPhysics.DetachRigidbody(physicsHit.hitElements[x].rigidbody, connectedJoints[x], false); } connectedJoints.Clear(); }
public static void ReleaseGrabPoint(GrabPoint grabPoint) { if (grabPoint != null) { RagdollPhysics.DetachRigidbody(grabPoint.baseRigidbody, null, true); ReesetGrabPoint(grabPoint); grabPoint.gameObject.SetActive(false); } }
static void ReesetGrabPoint(GrabPoint p) { // detach our grab point, if it was attached at all RagdollPhysics.DetachRigidbody(p.baseRigidbody, null, true); p.baseRigidbody.isKinematic = true; p.baseRigidbody.useGravity = false; p.childRigidbody.transform.SetParent(p.baseRigidbody.transform); p.childRigidbody.transform.localPosition = Vector3.zero; p.childRigidbody.transform.localRotation = Quaternion.identity; RagdollPhysics.MakeJointDefault(p.baseJoint, freeRotation: false, Vector3.zero, Vector3.zero, p.baseRigidbody); }
public void Detach() { RagdollPhysics.DetachRigidbody(baseRigidbody, null, true); ReesetGrabPoint(this); gameObject.SetActive(false); }