pmndrs / xr

🤳 VR/AR for react-three-fiber
https://pmndrs.github.io/xr/docs/
Other
2.12k stars 152 forks source link

XR Controllers disappear when using conditional rendering #291

Closed netgfx closed 2 months ago

netgfx commented 1 year ago

Hello, I have this example https://codesandbox.io/s/react-xr-simple-demo-with-swap-6l8xzd?file=/src/index.tsx where I'm making a sphere geometry appear when a button is clicked via react conditional rendering. This action is making the Controllers (Oculus quest 2) disappear, although moving them around and squeezing will emit events and interact, I believe only the 3D models aren't visible.

If the session is somehow restarted (taking off the headset and on again) will make the Controllers appear again.

Not sure if this is a known issue or if my implementation is somehow faulted.

netgfx commented 1 year ago

narrowing it down, it seems that when the useLoader or useTexture is used (even if the result doesn't get used) the Controllers are disappearing.

CodyJasonBennett commented 1 year ago

Is this still an issue with v5.6.2?

netgfx commented 1 year ago

@CodyJasonBennett I'll check out on headset tonight and report back. Thanks for the effort!

eigilnikolajsen commented 1 year ago

I'm still having this issue in version 5.7.0 When previewing in Meta Quest Browser the controllers dissappear when loading a video texture. If I exit and reenter the VR experience the controllers show up again.

chriskch commented 10 months ago

Are there any news on that?

CodyJasonBennett commented 8 months ago

From Discord, looks like state is not being created correctly when XR remounts.

MirkoCzo commented 6 months ago

From Discord, looks like state is not being created correctly when XR remounts.

Hi, is there any way around this problem?

MP242 commented 2 months ago

Hello! Is the problem still unresolved?

bbohlender commented 2 months ago

@MP242 @MirkoCzo @chriskch @eigilnikolajsen should be resolved in v6. Feel free to reopen if something doesnt work. Since you probably need to migrate from v5, here's the migration guide.