public void deActivateRagdoll() { foreach (Rigidbody rbs in gameObject.GetComponentsInChildren <Rigidbody>()) { rbs.isKinematic = true; } foreach (Collider col in gameObject.GetComponentsInChildren <Collider>()) { col.enabled = false; } rb.isKinematic = false; collider.enabled = true; animRef.enabled = true; if (gameObject.CompareTag("Player")) { characterContRef.enabled = true; } else if (gameObject.CompareTag("AI")) { aiControllerRef.activateNavMesh(); } }
IEnumerator respawnAfterDelay() { yield return(new WaitForSeconds(3f)); gameObject.transform.position = respawnPoint; animRef.stopDeadAnim(); animRef.playRunAnim(); if (gameObject.CompareTag("AI")) { aiControllerRef.activateNavMesh(); } else { characterContRef.enabled = true; characterCam.Priority = 1; deathCam.Priority = 0; } yield break; }