Crash on porting an existing app: "No ornament manager"

I’ve updated an existing game to try the latest 0.3.3 Polyspatial version, and while previously our use of async loading was causing a crash, it seems that crash has been fixed, but now we’re getting:

StopwatchSupport/XRSheetHostManager.swift:76: Fatal error: No ornament manager

Has this been seen before? I’m going through our setup code to see what might be causing it, it looks it might be related to “yield return new WaitForSeconds()” but don’t know for sure yet.

After some testing I’ve tracked it down to the game having Game Center enabled in Entitlements and Capabilities in Xcode. Removing those has fixed the crash for now, I guess this is an issue on Apple’s end with properly supporting this feature.

My guess is that the “Ornament Manager” refers to something to manage the Game Center UI bubble that appears on iOS, MacOS apps when you login to Game Center.

1 Like

Glad you were able to find the issue! We haven’t tested libraries / features like gamecenter on our side yet.

I’d assume that as well, ornaments in a concept around having additional UI elements that are layered around SwiftUI windows see: Ornaments

1 Like

@DanMillerU3D

We haven’t tested libraries / features like gamecenter on our side yet.

What’s the current status of Game Center?

Game Center works fine if the user is already logged in (e.g., via Settings app), but crashes on startup if the user is logged out (an Apple issue, not Unity).

1 Like

For now, authentication in GameCenter (if there is no user logged into the system GameCenter), only works if the application/scene uses bounded volume.

In the case that you use unbounded volume, and try to open the native panel to authenticate in gamecenter (from Unity), the application crashes.

The problem is located in GameKit library, in the call to authenticate to GameCenter (And it can’t be fixed from Unity, just use bounded volumes):
GKLocalPlayer.local.authenticateHandler

1 Like

I’m just encountering the crash (when not logged in thru Settings) in a fully immersive app. I’m logging in using Unity’s social APIs like this:

  Social.Active = new GameCenterPlatform();
  Social.localUser.Authenticate(OnGameCenterAuthenticated);

Has anyone found a way to detect you aren’t logged in, so we can avoid triggering the crash? Maybe I need the full GameKit lib for that? That way, at least I could provide an error and keep leaderboards working if you are logged in…

I’ve read in some other places, that the callback for Authenticate does not properly trigger (this is a reason why people were directly using a modified version of the Apple Unity GameKit library). I do this:

// As part of some initialization function

            // Authenticate the user through GameCenter.
            // This call needs to be made before we can proceed to other calls in the Social API
            Social.localUser.Authenticate(success =>
            {
                if (!success)
                {
                    Debug.Log("EP: Apple GameCenter was not authenticated.");
                }
            });

So, that lambda may or may not be triggered, so any time I go to do anything in the Social.localUser, I also check

            if (Social.localUser.authenticated)
            {

Now, this is fine for us, because if the user isn’t logged in to GameCenter already, we just carry on and not care (gamecenter is not a requirement for us). We don’t specifically ask the user to login - so if your app can survive not having GameCenter logged in, this might help.

1 Like

This works on devkit ? Doesn’t trigger the crash ?

Did this get fixed by apple? I think im still seeing this outcome with the latest gamekit plugin version
“com.apple.unityplugin.gamekit” : “2.2.1”

Yes, it was fixed in visionOS 1.0.2.

1 Like

I ran into this issue but it was because I was use the Simulator with VisionOS 1.0. Changing to use the Simulator with 1.2 resolved this issue for me.