02-29-2024 05:18 AM
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
Solved! Go to Solution.
03-01-2024 12:51 PM
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!
02-29-2024 11:28 AM
Hi @TiyoPAENGski, could you provide some more details about what exactly you're trying to do with the ray interaction?
02-29-2024 05:41 PM
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.
03-01-2024 12:51 PM
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!
03-02-2024 10:53 PM
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!
03-04-2024 09:36 AM - edited 03-04-2024 12:46 PM
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 🙂