private void Update() { if (ragdoll == null) { return; } // If the ragdoll is returned to the pool, stop tracking it. if (!ragdoll.isActiveAndEnabled) { ragdoll = null; return; } var focusPosition = ragdoll.CentreBone != null ? ragdoll.CentreBone.transform.position : ragdoll.transform.position; TurnToFace(focusPosition); }
private void Awake() { ragdoll = GetComponent <PoolableRagdoll>(); gunSocket = GetComponent <GunSocket>(); }
private void OnRespawn(Empty empty) { ragdoll = null; playerCamera.transform.localPosition = Vector3.zero; playerCamera.transform.localRotation = Quaternion.identity; }
private void SetRagdoll(GameObject ragdollObject) { ragdoll = ragdollObject.GetComponent <PoolableRagdoll>(); }