Screen.height Screen.width returning strange values

I’m writing a script which disables the Mouse Look script when the cursor is moved outside of the player window, but:

Screen.width is returning the width of my full screen (1440) and Screen.height is returning 20. These are not the size of the player window as I’m currently working in the editor.

Has anyone else had this problem?

Is this in the editor or a build?

I’ve observed that if you do not have a Game view active when you press Play in the Editor, then the screen size is not reported accurately, even in Unity 3.1

Hmmm.

I’m experiencing the problem in the editor.

This might be a stupid question, but is there any way to view the Screen.height and width values while in playing a build?

void OnGUI() 
{
	GUI.Label(new Rect(Screen.width/2 - 50, Screen.height - 50, 100, 50), Screen.width.ToString() + " x " + Screen.height.ToString());
}

You’ll probably not want that in your final build of course, unless you think it would look cool for some reason.

JRavey, thank you so much. It would have taken me days to figure that out!