I am trying to write a script for my mobile game (my first unity game) and I want to enable the “Dead” menu when the player is destroyed and that works fine, but when i want to disable it it does not work, hre is my code: (i know its messy)
public class DeadMenu : MonoBehaviour
{
public GameObject deadMenu;
public void Retry()
{
deadMenu.active = false;
SceneManager.LoadScene("Game");
}
void Update() {
if(Player.destroyed)
{
Appear();
}
}
public void Appear()
{
deadMenu.active = true;
}
}