void Death() { // Set the death flag so this function won't be called again. //isDead = true; // Turn off any remaining shooting effects. //playerShooting.DisableEffects(); // Tell the animator that the player is dead. //anim.SetTrigger("Die"); // Set the audiosource to play the death clip and play it (this will stop the hurt sound from playing). //playerAudio.clip = deathClip; //playerAudio.Play(); // Turn off the movement and shooting scripts. playerMovement.enabled = false; //playerShooting.enabled = false; playerShooting2.enabled = false; MyUIScript.ActiveMenu(); }