Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.4
2020.1.0b15
2021.1
Issue ID
1262578
Regression
No
[Android] [WebGL] "Constant Pixel Size" Canvas UI Scale Mode has no effect when changing screen orientation
Reproduction steps:
1. Download and open the user-submitted project "UnityWebGLGyroscope2.zip"
2. Build for WebGL
3. Create a server using this "python -m http.server" command in the Command Prompt
4. Navigate to the built WebGL page on your Android device using your IPV4 address
5. Change screen orientation to Landscape/Portrait
Expected result: The UI button size remains constant
Actual result: The UI button size changes based on screen orientation
Reproduces on: 2018.4.28f1, 2021.1.0a1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note (2021.1.X):
To ensure that the screen resolution remains consistent when the screen rotates, ensure that the page has a meta viewport tag. The default template creates an appropriate viewport tag by default with the code:
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
document.getElementsByTagName('head')[0].appendChild(meta);
...