World mouse position not depending on Screen mouse position

I made a very simple script showing both the Screen and World coordinates of the mouse in the inspector :

var mousePos : Vector3;
var worldPos : Vector3;

function Update ()
    mousePos = Input.mousePosition;
    worldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);

However, worldPos does not depend on the actual position of the mouse at all. It's always just above my character's head (what looks like the center of the camera). The script above is attached to an empty GameObject with no parents/children. I also hid the cursor to replace it with a GUI Label.

Thanks for any help.

You need to define some kind of Z position to get useful data from ScreenToWorldPoint. Try this:

mousePos = Input.mousePosition;
mousePos.z = 1.0;
worldPos = Camera.main.ScreenToWorldPoint(mousePos);

That function will always return the position of the camera when the vector you pass in has a z value of 0

The function basically gives you the world position depending on what distance from the camera you ask for - if you want to know what world point your mouse is selecting, you either need to decide a distance, or use raycasting instead