Canvas disappears completely after calling SetResolution

I had a setup working ever since the beginning I’m working with one of my projects. Started using Unity 4.6, then 5.1.3f1 and now I’m working with Unity 5.2f1, although I’m not sure if this is related and it’s related.

I’ve tested this with a sample build up:

  • Camera
  • Canvas
  • Text
  • Another object calling the SetResolution method in Awake

What I found out so far is that calling Screen.SetResolution(1280,480,[true|false]); made all Canvas objects disappear completely from the rendering when built the project (Development Mode didn’t change anything). During Editor runtime all is fine.

The Canvas is set to Screenspace Overlay and the reference resolution in the Canvas Scaler is set to 1280*480.

Has anybody a clue why this is happening?

Deploying a build with 5.1.3f1 makes the Canvas stay.

Also this post describes the issue the best and also points to all the issue trackers:
http://forum.unity3d.com/threads/5-2-canvas-stops-rendering-in-windows-standalone-in-d3d9.355944/

With this the only conclusion is to roll back to Unity 5.1.x if you rely on the SetResolution + Canvas setup. :frowning: