I have a lose screen that activates after you fail a level all that is fine but how do i match the game object in my hierarchy to the one in the script i tried using tags but i keep getting null reference exception i know what it means but i just can’t get it to work i even tried looking up a guide by unity but all they showed me was gameobject.SetActive(false); they didnt tell me if i needed to put anything outiside of script and I’m really confused please help!
There are two simple ways to get one object into the scene:
The first one is to find the object by code (c#):
GameObject Menu = GameObject.Find("name");
NOTE: This will not find anything if the object is not active
The second one is to declare a public variable and assign its value from editor
public GameObject Menu;
If menu object is disabled then you can use
Menu.SetActive(true);