Quantcast
Channel: Answers by "RedDevil"
Viewing all articles
Browse latest Browse all 92

Answer by RedDevil

$
0
0
You cannot acces the gold amound like this mainScript = GameObject.Find ("Main Camera").GetComponent(goldAmount); GetComponent is meant for getting components of an object.Like getting the transform property or a script but definetly not a variable from that script. Try like this: var MainScript = GameObject.Find ("Main Camera").GetComponent("mainScript"); //i would change the variable named mainScript too so there are no confusions... //then you acces it through the MainScript object MainScript.goldAmount = 100;

Viewing all articles
Browse latest Browse all 92

Trending Articles



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