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

Answer by Burla

$
0
0
If your variable *scoreCount* isn't already both *public* and *static* you could do that, which makes it accessible from the second script. The *NullReferenceException* can easily be solved by using the function *GetComponent()*. The way to do that would be to declare a variable in the top of your script. var levelMaster : LevelMaster; The above code is what you already have. In the *Start()* function you should put the following code. levelMaster = GetComponent(); This should make the reference correct. The above is similar to instantiating a class which is shown below. var levelMaster = new LevelMaster(); If anything of what I've written is wrong, please feel free to correct me. Let me know if this solved your problem.

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images