'Reload scene in unity activates UI that shouldn't be activated

enter image description here

so by default GameOverMenu is disabled and when my player dies it gets activated, then when i revive player and scene reloads it becomes active from the start, how can i prevent this? how do i make it so that GaveOverMenu is disabled always until the player dies.



Solution 1:[1]

You can create script and attach it to your GameOverMenu which has declared void Awake() method. In this method you can disable game object by calling gameObject.SetActive(false) - it's gonna be called when scene starts/reloads.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 FreezeBee