How to close an Unbounded volume experience from Unity C# code

I created an unbounded volume experience for Vision Pro using Unity Polyspatial. I am able to launch the app, and everything works fine.

The issue is that I do not know how to close the experience with a Click on a button.

I have tried the Application.Quit(), but it does not work for this kind of experience.

I was wondering if there is a way to do it directly from C# code, so that once a user clicks on a button we provide within the experience, the experience can close and go back to the Vision Pro Home menu.

Why not? Do you mean that this doesn’t actually quit, or that it isn’t appropriate for your use case? Application.Quit is the proper way to quit the application from C# code.

I tried it, and it does nothing. So I am not longer sure. That is why I am asking. If anybody has a way that works, they can share.

Huh! I’m pretty sure we’ve tried Application.Quit() on our end, but maybe there’s been a regression introduced. Maybe it quits but doesn’t properly close the SwiftUI scene and that’s why the home screen doesn’t show up? Does the app just keep running?

Either way, this is almost definitely a bug. Can you please submit a bug report?

I tested it on the Simulator, and it was not responding. I am trying to build it to the real device, maybe it will work there.

I will submit a bug report after I am done. Thank you

2 Likes

wow. i always just assume the user would press the home button to quit… i’ve never thought of adding a quit button for immersive mode!

Use a platform-specific API since Application.Quit() can`t doesnt work for Vision Pro.

Any updates on this topic?

I managed to get around this problem, before Application.Quit(); i change volumeCamera WindowConfiguration to bounded.

1 Like