Digital Speedometer: Editing UI Text with Unity 5

I want to edit a unity 5 ui text (not a guitext component, but a ui text on the canvas) in a script to show speed. I also dont know the new syntax for speed in rigidbodies. Thanks in advance.

To access UI components(UI TEXT)in unity your code should look like these:


#pragma strict

var UIObject : GameObject;
var UIText : UI.Text;
var UText : string;
function Start()
//The UI Object is the Object that Contains the Component //Text from the UI Menu
//UI Text is the Actual Text Component From The Object

UIText = UIObject.GetComponent("Text");

//The Statement Above Assigns the Text Component 
//To Actually get the Text though you need to use

UText = UIText.text;

// The statement Above Assigns the UIText Value to the //string, so if user entered bob the UText string
//Would be bob but notice this only happens in start.
//You Should put it in update to constantly get the value.
//of the UI Text