"Score" Help please.

Hi all programmer out there. I having trouble getting of Score using GUIText. i am doing a 2d top-down game. i have my “player” destroyed a “cash” object. however, i need to gain some figures from destroying the cash by using GUIText, but i couldnt get it. can someone help? Thanks in adv!

http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-text

The Unity3D way is to make a public GUIText member variable on your script, use the Unity editor to fill that value in with the GUIText you have set up for displaying the score, and then when you are ready to display the score, do something like this:

guiTextReference.text = System.String.Format( "Score: {0}", currentScore);

Since Unity 4.6 there is a new GUI system, which makes GUIText somewhat obsolete. So, you probably want to look into the new GUI instead. Here is some info about the new Text class: http://docs.unity3d.com/ScriptReference/UI.Text.html