I have a game object called "Keep" with tag "Keeper" that stores variables between scripts, it has an attached script called "SaveMe.cs"
In SaveMe.cs...
void Awake()
{
DontDestroyOnLoad(this.gameObject);
}
In another scene an object tries to access this game object with the code...
private void Awake()
{
keeper = GameObject.Find("Keep");
}
I get NullReferenceException: not set to instance of an object through this line of code
What do I do?
↧