Search Unity

Oculus Go Scene Change

Discussion in 'AR/VR (XR) Discussion' started by DigitalCM, Apr 3, 2019.

  1. DigitalCM

    DigitalCM

    Joined:
    Jan 16, 2019
    Posts:
    1
    Good morning!

    I have been working with Unity for a few years but I am a designer not a programmer. I am looking for an easy way to change scenes in a project built for the Oculus Go. I have been using playmaker for the Rift and HTC but can't seem to get it to work with the Go. Any feedback would be great, thank you!

    Thanks,
    Mike
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I don't know anything about PlayMaker, but to change scenes you can just do something like this:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. public class SceneLoader : MonoBehaviour {
    4.  
    5.     public void LoadScene(string sceneName) {
    6.         UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName);
    7.     }
    8.  
    9. }
    Make a script like the above, attach it to any object in your scene, and then invoke the LoadScene method from some event (say, a button's On Click event). Fill in the name of the scene to load, which must be in your Build Settings. That should do it.

    P.S.: if you're working with Oculus Go, you should join the GOmmunity Discord server. You'll find lots of very helpful and enthusiastic Go users and developers there.
     
  3. outpost31d

    outpost31d

    Joined:
    Feb 1, 2019
    Posts:
    11
    quick question, how could i ensure that the event i will use to invoke the LoadScene
    is the trigger pull on the oculus go?