Screen.width Returns 0 on Start() and first Update() on Mac OS X

Is this behavior expected? It's relatively easy to work around but seems wrong, especially since it behaviors differently on Windows, and the docs don't specifically specify a lifecycle for Screen.

cheers, eric

I'd agree, that does seem wrong and sounds like a bug. If it's reproducible, I think you should submit it using unity's bug report tool.

I just tried this, and for me it seems that Screen.width returns the correct value in Start. Do you get the problem with a minimal test script like this?

public class NewBehaviourScript : MonoBehaviour {

int width, height;
// Use this for initialization
void Start () {
	width = Screen.width;
	height = Screen.height;
}

// Update is called once per frame
void OnGUI () {
	GUILayout.Label (Screen.width + "x" + Screen.height);
}

}

Can you provide an example project? Maybe the problem is caused by something specific to your setup.

I seem to have the same problem on iOS after an update from to 2019.2.3f1 to 2019.3.5f1.
No other changes made in the project.