Search code examples
unity-game-enginehololensmrtk

Hololens 2 Unity app rarely renders anything to the screen


So this question I think is the same as this but the solution for this problem was downgrading to Unity 2017 LTS, which is incompatible with my current project.

Basically, whenever I build, there's maybe a 10% chance that the app runs in the Hololens. Most of the time however, no floating balls animation pops up, no Unity splash screen appears, and I don't see any of my app content. Strangely enough, the app does ask for microphone permissions, but that's all. It should ask for eye tracking too, but it doesn't. (Not sure if that's related but I'm out of ideas.) On a proper run, I get the floating balls, Unity splash, and all permissions asked before the content. The most frustrating part is that it sometimes works, and there has been no trend at all towards what helps or what doesn't.

I've tried rebuilding in Unity, redeploying in VS, reinstalling the appx, updating VS, updating Windows, and checked every forum post I could find but I can't figure this out. Does anyone have any ideas?

I thought it might be an OpenXR / Holographic remoting problem, but those have both been dead ends. Really not sure what to do at this point. Thanks in advance.

Unity version: 2020.3.36f1, VS 2022, MRTKv2, HoloLens 2


Solution

  • Thanks for the help everyone! For some reason, my solution is just as confusing as the problem, but it seems to reliably work.

    Problem has something to do with the Holographic Remoting for OpenXR, so simply enabling and then disabling that feature in the editor right before building seems to fix a buggy build. Tested this a few times now and it works pretty consistently. Hope this can help someone and eventually get patched.

    EDIT: Previous answer didn't work. Now I'm thinking the problem was actually caused by a toggle in the Project Settings. For a successful build it seems as though XR Plug-in Management > Windows Mixed Reality > UWP > Use Primary Window should be checked on. Seems weird since I'm using OpenXR anyways, but this might help someone so thought I'd update. Works most of the time now - needs more testing.