showing variables

how can i show variables on screen… example is you declare a var = 10; then it is printed on the screen…

'cause the error says “no appropriate version” , “convert string to float” (i’ve tried var : float = 10;) , i also try GUIelement but it doesn’t work. a little help please :slight_smile: i cant find it in the references even in the scripting references

Ok, so I’m guessing the problem is you are trying to show a value in the GUI, and that value is not a string?

// static function Label (position : Rect, text : String) : void 
GUI.Label (Rect (10, 10, 100, 20), "Hello World!");

So GUI needs a string. How to convert an integer or a float to a string? Append ToString() after your variable :

GUI.Label( Rect( 10, 10, 100, 20 ), "" + myFloat.ToString() );