Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
TiyoPAENGski's avatar
TiyoPAENGski
Explorer
1 year ago
Solved

Change Scene

Hi. Can somebody help me? I want to change my scene from scene 1 to scene 2. I'm using Meta Quest 2 and I'm using Meta SDK Ray Interaction. Can somebody show me a step by step process on how to do it. Thank you

  • Big_Flex's avatar
    Big_Flex
    1 year ago

    Thanks TiyoPAENGski for the extra info! I work on the Interaction SDK team, so tag me if you have any Interaction SDK questions in the future. You can check out the ExamplesMenu GameObject (the scene selection menu in the RayExamples scene or any other scene) to see how we load scenes when you press a button. I'll also briefly explain the process here.

    1. Create a GameObject and add the Scene Loader component to it (you can find the Scene Loader component by searching under Project for Scene Loader; its file path as of the current version, v62, is Packages/com.meta.xr.sdk.interaction.ovr.samples/Runtime/Scripts/SceneLoader.cs.

    Image 1. The ExamplesMenu GameObject that's included in all Interaction SDK sample scenes. It uses the Scene Loader component.

    2. In the GameObject of the button or whatever you're interacting with, add a Pointable Unity Event Wrapper component.

    3. Set its Pointable to your interactable (in the example image below, it's a poke interactable, but you'd be using a ray interactable).

    3. In the When Release event, call the Scene Loader GameObject and pass it the name of the scene you want to load.

    Image 2. Listening to the interactable and triggering a scene change whenever the interactable is released.

    I hope that helps, please let me know if you have additional questions about the SDK!

     

5 Replies

Replies have been turned off for this discussion
  • Big_Flex's avatar
    Big_Flex
    Meta Employee

    Hi TiyoPAENGski, could you provide some more details about what exactly you're trying to do with the ray interaction? 

  • Hi. I'm using the ray interaction to interact with a button. My goal is that after I click the button it will change to another scene. From main menu to the actual game. 

    • Big_Flex's avatar
      Big_Flex
      Meta Employee

      Thanks TiyoPAENGski for the extra info! I work on the Interaction SDK team, so tag me if you have any Interaction SDK questions in the future. You can check out the ExamplesMenu GameObject (the scene selection menu in the RayExamples scene or any other scene) to see how we load scenes when you press a button. I'll also briefly explain the process here.

      1. Create a GameObject and add the Scene Loader component to it (you can find the Scene Loader component by searching under Project for Scene Loader; its file path as of the current version, v62, is Packages/com.meta.xr.sdk.interaction.ovr.samples/Runtime/Scripts/SceneLoader.cs.

      Image 1. The ExamplesMenu GameObject that's included in all Interaction SDK sample scenes. It uses the Scene Loader component.

      2. In the GameObject of the button or whatever you're interacting with, add a Pointable Unity Event Wrapper component.

      3. Set its Pointable to your interactable (in the example image below, it's a poke interactable, but you'd be using a ray interactable).

      3. In the When Release event, call the Scene Loader GameObject and pass it the name of the scene you want to load.

      Image 2. Listening to the interactable and triggering a scene change whenever the interactable is released.

      I hope that helps, please let me know if you have additional questions about the SDK!

       

      • TiyoPAENGski's avatar
        TiyoPAENGski
        Explorer

        Wow. It finally works. Thank you so much!

        But I have another problem. I have a button named About. My goal is that after I click it, it shows the information about the game I'm creating without leaving the scene. Maybe you have an answer to this problem. 

        Thank you again!