can you have 2 of diffrent scripts togheter
2 answers · asked
Problems with packages
6 answers · asked
I've been working on the Space Shooter lessons. I started with the original course that used unity 4.6. That caused a problem because there is a lot of differences in the C# script. Unity tried correctly what I had input, but there were too many errors. I figured I would downloaded the mobile version of the project, get updated scripts in that. But I am getting these errors....
NullReferenceException: Object reference not set to an instance of an object
GameManager.Start () (at Assets/MobileSpaceShooter/Scripts/GameManager.cs:54)
That line referencing this line ...
scoreText = scoreText.GetComponent<Text> ();
Now, I think it is related to the UI element ...
public Text scoreText;
I've done some research and it looks like an error that you get when you haven't put something in the inspector correctly. But when you select the GameManager in the assest, the section for scoreText won't allow you to drag any GameObject into the window.
In the mobile version, there is a ....
public GameObject scoreText;
But it is commented out. I tried messing around with that but that just created more error.
I think I am close to an answer but I am missing something. It seems like the scoreText.GetComponent<Text> line isn't working.
I've imported the entire package from the first and last unity package that was included in the downloads. Both have the same errors.
Below is a screenshot of unity . You can see that I have filled in the inspector but those at the bottom, Score text that is listed a None(text). That seems to be the problem. I have been chasing this problem around for too long by myself and need a second opinion.