Screen.width/height is always 466x978?! No matter what I do.. why on earth is that?

:rage:Unity Pro 4.3.4f1 (run under Win7 with -force-opengl, project is Android/GL-ES).

Extremely simple new from-scratch Scene: standard camera, standard directional light, one unit cube, one standard plane.

No scripts, no Standard Assets, no other customizations.

I attach the following script to the camera and disable it initially:

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(Camera))]
public class azCamMrtTest : MonoBehaviour
{
	
		void OnEnable ()
		{
				Debug.Log (Screen.width + "x" + Screen.height);
		}
	
}

Remember, script is initially disabled. I run this Scene (via the Play button) in Game View and then enable the script on the cam. No matter what resolution the Game View has when I do so (any of the presets like 800x600 etc. or also even Free Aspect), all that is ever output in the Console is 466x978. Always those numbers in that order. This is the only resolution that Screen.width/height seem to know and return.

How the hell can this be? And all of a sudden, too: I’ve worked with Screen.width/height many times. Remember, I can guarantee the above script is the only custom code running whatsoever. Also restarted Unity directly into this simplest of scenes, same problem.

What kind of crazy bug did I run into now?! :?

I have to ask, because you didn’t mention it: have you resized the Game View?

Oh my, the correct width/height isn’t apparently available in OnEnable even if this happens long after the first frame was rendered. With OnStart, it is. Still somewhat buggy in my book but OK, I’m good to go

what starManta has asked.

You can have that set to any resolution, but windows will save it to your last resize.