aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.61k stars 3.94k forks source link

Camera position is reset when entering/exiting VR on iOS #4720

Open antoninklopp opened 3 years ago

antoninklopp commented 3 years ago

Description:

Camera position is reset when entering/exiting VR.

Repro steps :

Additional information :

dmarcos commented 3 years ago

That's expected behavior. The headset pose is applied to the camera entity. To position the camera use a camera rig:

 <a-entity id="rig" position="25 10 0">
  <a-entity id="camera" camera look-controls></a-entity>
</a-entity>
antoninklopp commented 3 years ago

Hi @dmarcos,

Thanks a lot for explaining how to get around the issue. However, the position is restored when exiting VR on Android but not on iOS.

This code seems to try to restore it.

Are these behaviour differences expected depending on the device?