De-Panther / unity-webxr-export

Develop and export WebXR experiences using Unity WebGL
https://de-panther.github.io/unity-webxr-export/
Apache License 2.0
1.04k stars 110 forks source link

Screen orientation in AutoRotation mode doesn't work in AR Mode #373

Closed jesuscfp closed 5 months ago

jesuscfp commented 5 months ago

If I add the line Screen.orientation = ScreenOrientation.AutoRotation on the method Awake of my script, when the App starts the AR Mode, it never changes the screen orientation when the device changes the rotation

Steps to reproduce the behavior:

  1. Create a Script and and on Awake method, add the line Screen.orientation = ScreenOrientation.AutoRotation
  2. Add a Canvas with a text.
  3. Build the project.
  4. Run project and into in AR mode, then turn left or right your device

Unity info: Editor version: 2021.3.15 WebXR Export version: 0.21.0 WebXR Interactions version: 0.21.0

Smartphone: OS Device: Android 11 Browser: Chrome 121

De-Panther commented 5 months ago

As far as I know, it's not something we have control over in WebXR. The orientation the phone was at when requesting AR session, that would be the orientation for the duration of the session.

jesuscfp commented 5 months ago

I wasn't sure if it would be a enhancement more than a bug. I will try to implement my own method.

Thank you!