Search code examples
unity-game-enginesteamvr

Why does the scene camera change position and rotation on play


Win 10 Pro, Unity 2019.2.17f1

This issue occurs on occasion, randomly. It has happened with multiple different scenes on this machine.

In this instance, I have a scene that is completely empty except for the default Main Camera and Directional Light. I have not added any scripts to the scene. In the inspector the camera is at position 0, 10, 0 with rotation 90, 0, 0 by default. Once I hit play, the camera instantly jumps to a seemingly random position and rotation. If I delete the main camera and make a new camera game object, the same thing happens to it. Please see this screen recording demonstrating the problem:

https://youtu.be/JMl2arXzeCo

I'm thinking it might have something to do with the fact that I have SteamVR running on my machine. Does anyone know what causes this, and where I might be able to find a setting to toggle this behavior? Thank you


Solution

  • In the console you get

    OpenVR Initilaized

    You seem to have Virtual Reality Support enabled in the ProjectSettings -> Player -> XR Settings thus the camera position and orientation is controlled by a virtual reality device.

    From the orientation I would guess that it lies around somewhere ^^

    Simply disabling this should fix your issues.