I am experiencing some weird behavior. I am making a VR game in Unity using OVRPlayerController. I have a menu scene that is a full small level with an OVRPlayerController and when you press a UI element it loads another scene with an OVRPlayerController.

If I load the scenes individually then everything works perfectly - however, when I transition from the menu into the scene - the player controller position is changed. I wrote a script to fix this - however now when I go from the menu, to the scene, and back to the main menu, the player position there is changed. I even tried using a static class to determine if it is the first time the scene is loaded and to position things differently to try and overcome this behavior - but I think maybe I am just misunderstanding something. Is the player controller from the menu scene being taken into the second scene and maybe that is what is causing this weird position shift? When I come back to the menu level, one of the images also doesn't fully load that does load when you first start the game.

I don't understand why the process of loading the level does not simply load it fresh - and I am wondering if some scene state is being carried over even though I haven't specifically programmed that?

Any pointers would be much appreciated!

  • \$\begingroup\$ To help you debug your player controller, we would need to see the code you are using for your controller. To take it to the next scene, a gameobject needs to be marked as DontDestroyOnLoad. If you have one controller per level and you don't destroy it, your code needs to make sure there is only one controller. \$\endgroup\$
    – Zibelas
    Oct 28 at 14:50


You must log in to answer this question.

Browse other questions tagged .