Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Error enabling or disabling object which isn't null

$
0
0
Hello. I have a GameObject which I am trying to enable/disable (Using .SetActive()). However, when I use .SetActive() on the object I get the error *NullReferenceException: Object reference not set to an instance of an object*, however the object is not null. I only get this error after the scene has been restarted at least once. Code: public void Pause(bool boolean) { if (loadingScreen_Huh == null) loadingScreen_Huh = GameObject.Find("LoadingScreen"); loadingScreen_Huh.SetActive(boolean); Time.timeScale = CoreFunctionality.BoolToInt(!boolean); } When I get the error this is what is shown in the inspector: ![alt text][1] [1]: /storage/temp/204763-screenshot-2023-02-15-164611.png

Viewing all articles
Browse latest Browse all 2891

Latest Images

Trending Articles



Latest Images

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