Forum Discussion
TiyoPAENGski
1 year agoExplorer
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...
- 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!
TiyoPAENGski
1 year agoExplorer
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!
Big_Flex
1 year agoMeta Employee
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 🙂
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 months ago
- 4 years ago
- 2 years ago