Roll a ball tutorial: cannot drag canvas / text into "player" script

Hello Everyone,

I’m going through the roll-a-ball tutorial. I’m now attempting to have some text display on screen. It seem like Unity 4 replaced guitext with canvas/text. How can I drag my canvas/text into the player’s script?

here’s the code for the text in the player object.

void SetCountText ()
	{
		countText.text = "Count: " + count.ToString ();
		if (count >= 12) 
		{
			winText.text = "Success!";
		}
	}

In the tutorial, the demo shows this drag and drop method but this does not work for me.

You cannot add object of type ‘Text’ into a variable of type ‘GUIText’.
Type GUIText was used in old GUI. Type Text is used in new GUI.

To solve this,
Add this namespace in your script:

using UnityEngine.UI;

Change your ‘countText’ and ‘winText’ variable to type ‘Text’ instead of ‘GUIText’.
Then drag and drop your ‘count_text’ and ‘win_text’ objects into your script.