private void Update() { if (DoReset()) { ragdoll.Ragdoll(false, Vector3.zero); ragdoll.Ragdoll(true, Vector3.zero); } }
void OnReset(Transform value) { if (ragdoll.IsRagdolled) { ragdoll.hips.position = value.position; ragdoll.Ragdoll(false, Vector3.zero); ragdoll.Ragdoll(true, Vector3.zero); Physics.SyncTransforms(); } }
private void OnControllerColliderHit(ControllerColliderHit hit) { if ((cc.collisionFlags & CollisionFlags.Sides) != 0)//checks collision with anything that is not the player { if (!ragdoll.IsRagdolled) { ragdoll.Ragdoll(true, Vector3.up); } } }
void OnPositionReset(Transform respawn) { if (respawn != null) { ragdoll.hips.transform.position = respawn.position; } else { Debug.Log("Respawn Position not set"); ragdoll.hips.transform.position = Vector3.zero; } Physics.SyncTransforms(); ragdoll.Ragdoll(true, Vector3.zero); }
public void Grab(RopeSegment rope) { if (rope.ropeRenderer != grabbedRope) { grabbedRope = rope.ropeRenderer; //Ragdoll the character //Move hips to the rope position //Attach the joint to the hips _isOnRope = true; if (!ragdoll.IsRagdolled) { ragdoll.Ragdoll(true, Vector3.zero); } Attach(rope); OnRopegrab?.Invoke(rope); Physics.SyncTransforms(); } }
public void Ragdoll(bool value, Vector3 dir) { ragdoll.Ragdoll(value, dir); }