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
- Getting a deprecated package for JetBrains Rider pop up when opening or creating a project
- [Android] Volume level of the same audio file is different on Samsung Galaxy Tab A8 between 2023.3.0b3 and 2023.3.0b4
- ‘Expected end of value’ warning occurs when a property declaration includes five or more variable references
- Crash on BurstCompilerService::CompileAsync when entering Play mode in a specific scene
- InvalidOperationException when using Game Camera Preview in Scene window with a custom RenderGraph pass
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);
...