How to show player script variables on screen?

Hello.

I am working on a prototype for a future project and would like to be able to display player variables such as player speed, fall speed and so on. Sort of like a console, but only the player variables.

I think i saw somewhere how to display this on the camera object, but can't find it. Could someone point me in the right direction? :S I am using JS.

var speed = 20;

function OnGUI () {
    GUI.Label (Rect (10, 10, 100, 20), "Speed = " + speed);
}