cancel
Showing results for 
Search instead for 
Did you mean: 

Change Scene

TiyoPAENGski
Explorer

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

Big_Flex_0-1709325664944.png

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.

Big_Flex_1-1709325913321.png

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!

 

View solution in original post

5 REPLIES 5

Big_Flex
Meta Employee

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

TiyoPAENGski
Explorer

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. 

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.

Big_Flex_0-1709325664944.png

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.

Big_Flex_1-1709325913321.png

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!

 

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!

I'm glad I could help! In your About button, you want to add an InteractableUnityEventWrapper component--for more information about event wrappers, see the Event Wrapper doc. In the event wrapper component, add your function to the Select() event. Then your function will trigger whenever you select the button.

Also, if you wouldn't mind, mark my original response as the solution for your post. That'll help other people on the forum who have the same question notice that it's been answered 🙂