Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

How to access game objects that haven't been destroyed on load?

$
0
0
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?

Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>