There is this big grey loading screen that shows up when we boot up our mixed reality app (bounded). Is this a platform restriction by Apple or something Unity displays while loading up the app. We are having compliance issues with this being displayed. Could there be an option to disable this somehow?
This is a visionOS thing, that automatically displays if the app takes too long before showing something. I’m not sure what the exact time limit is, and I haven’t been able to find any details on if it can be disabled/customized.
But we’ve had success with loading an empty scene as the first thing, and then load the actual first scene after a few calls to Update. Something like this:
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadFirstRealScene : MonoBehaviour
{
public float delay = 1.0f;
public int minimumFrameCount = 3;
private float timer = 0;
private int frameCount = 0;
private bool alreadyLoading = false;
private void Update()
{
if (timer > delay && frameCount > minimumFrameCount && !alreadyLoading)
{
alreadyLoading = true;
SceneManager.LoadScene(1, LoadSceneMode.Single);
}
// Make sure we get one frame update first
timer += Time.unscaledDeltaTime;
frameCount++;
}
}
Note: The first scene should not include a Volume Camera, as that seems to add to the startup time…
We tried that exact solution but no luck unfortunately, it seems like the grey loading window opens as soon as you click the app no matter how fast it loads in
If you test in simulator you will always get the grey window in my experience. The device is faster at loading than the simulator, at least on the Mac mini M1 I use for testing.
It could be that you have some plugins or other stuff that loads during startup, making it slightly slower. We have set XR stuff to not load at startup for instance.
Did anybody find another solutions for this? The one suggested by @mikkel_lbs did not work for us.
We also tried to render something immediately on start like suggested and explained in the documentation.
I guess we have a special case since we’re starting in shared space in progressive mode and use a window for our Unity content.
If someone else is struggling with this: We fixed this by delaying the Unity startup process in Swift.
In UnityPolySpatialAppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
var args = CommandLine.arguments
args.append("-batchmode")
unity.run(args: args)
// Original Code - we postpone the Unity start, so the Splash Screen gets immediately shown
// var args = CommandLine.arguments
// args.append("-batchmode")
// unity.run(args: args)
return true
}
.
.
.
and then starting it in VisionOSBuildProcessor.cs
.onAppear {{
// We start Unity after the Arcade Screen was shown so we have no loading screen on app start
var args = CommandLine.arguments
args.append(""-batchmode"")
delegate.unity.run(args: args)
We’re looking to do something similar and skip the loading screen. I’m not following what you are saying to do in the second part of your post @KevHell. Are you moving the unity.run(…) call to another spot? Where is that spot?
As far as I understood what our swift developer said, he’s waiting for the Apple Arcade and company splash to be finished, then he’s calling unity.run
via a delegate.
Not sure if that helps, I can ask our swift guy for more information if you need further help.