I’m having a problem with entering xr. I’ve created a simple scene and added the default xr in my scene and a button that when clicked user should enter xr but it’s not working. what am I doing wrong here, any thoughts?
I was looking at your code it looks like the issue may be related to your createXR function. If I’m understanding correctly, you were trying to go for was to save a WebXRExperienceHelper so that you could call enterXRAsync. The issue is that when the timeout completes in createXR, it will still return a Promise object, rather than just returning a WebXRDefaultExperience object. You might want to try using .then():
Depending on how tied you are to setTimeout, you can always just omit that entirely.
That brings me to my next finding. Because your helper variable is of the type WebXRDefaultExperience, you won’t have access to it unless you go into the baseExperience variable. Inside of your enterXR function, you can simply add baseExperience and that function should be accessible: