My Problem is simple I want to show scores on my game. The examples on internet are good but in Unity 5 there are no
GUI elements but instead these are now
UI elements. I was following this example: https://unity3d.com/learn/tutorials/projects/space-shooter/counting-points but it didn't work.
I followed the code and added a new
UI text to the scene as in the picture.
After adding the script to a
.cs file and declaring
public GUIText scoreText; and making this text as
prefab when I drag it to the inspector panel it didn't get attached.
and it gave this error:
The variable scoreText of Fruits has not been assigned. You probably need to assign the scoreText variable of the Fruits script in the inspector.
Fruit is a projectile and every time this projectile hits the container it should add the score. So how to do this in Unity 5. I've seen in one example online that on previous versions of unity there was this option of adding
GUI Text in GameObject.