Quantcast
Channel: Answers for "Having trouble updating the text in my GUI"
Viewing all articles
Browse latest Browse all 4

Answer by robertbu

$
0
0
Declaring the variable does not give you access to the LevelMaster script. You have to initialized 'levelMaster'. You can do it my first selecting the game object with the obove script and dragging and dropping the game object that has the LevelMaster scrip onto the 'levelMaster' variable in this script in the Inspector. Alternately you could do it dynamically. In start, you can add: levelMaster = GameObject.Find("NameOfLevelMaterGameObject").GetComponent(LevelMaster); If you've initialized by dragging and dropping and you still get the null reference error, search your Hierarchy to see if you have the above script attached to more than one game object.

Viewing all articles
Browse latest Browse all 4

Trending Articles



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