Follow

Using LoadScene

In order to load another scene, you will need to keep the same MVRManager object between scenes.

- You can set an object not to be destroyed on load. This means this game object and his children will never be destroyed after changing level:
https://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html

- Caveat: Unity will make this work only if the manager is at the root of the unity hierarchy, so it can't be a child of anything. If you need the MVRManager to move with a given object, you can simply create a script that copies the world position / rotation of that object to the MVRManager.

- There can't be another MVRManager in the loaded scenes. You can have one for debugging that scene, but when you export your project make sure to disable all the MVRManager except the one in the first scene.

- You can also load a scene with LoadSceneMode set to Additive. This will add to the scene loaded to the current scene.
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadScene.html

You can find two examples in the link below that work with MiddleVR: https://www.middlevr.com/2/files/ChangeLevelExample.zip

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk