- Home /
Question by
CrazyNito · Sep 30, 2020 at 06:40 PM ·
webglscreen resolutionscreen sizescreensize
Screen size on WebGl
How can I get screen size when running on WebGl? I have 1200x800 canvas. Screen.width returns 300 in browser and 1200 in editor. Screen.currentResolution is also wrong. This happens in WebGl on desktop and mobile browsers.
Is there any reliable way to get screen size in pixels when running on WebGl?
Comment
Best Answer
Answer by CrazyNito · Sep 30, 2020 at 09:41 PM
Found a solution:
It appears that Screen.width is just wrong on Awake(). I tried getting it in Update() and Start() and now it works fine.