Unity UI examples in the HandInteractionExample scene do not respond to the input when the scene is loaded through Examples Hub using the Scene System. It works fine when opened as a single scene.
Can interact with Unity UI


Editor and HoloLens 2 device.
Here's the problem, as far as I can tell.
MixedRealityInputModule caches an input system reference and a raycast camera reference inActivateModule(), which is called by the event system on startup.LoadProfilesOnStartup script causes MixedRealityToolkit.DestroyAllServices() to be called, which tears down all services. At that point MixedRealityInputModule's cached references point to a destroyed camera object and destroyed service.MixedRealityInputModule.ActivateModule() is never called again and the module no longer functions.This is going to be a problem for anyone switching profiles regardless of scene loading.
As a kludge we could manually disable / enable the event system in our scene system load / unload calls, but that only helps people using the scene system, and it doesn't help anyone switching profiles outside of a scene load operation.
I'm experimenting with ways to manually activate the module from within the input system, but this is tricky because we have to work around the event system's life-cycle. I'm passing this off to @davidkline-ms, who's already doing active profile switching work.
Related: #4289
I wonder if this is also the root cause of #5887.
@davidkline-ms and @Railboy, when you get this issue fixed locally, can you follow the repro steps in #5887 and see if it resolves that issue as well?
Not a regression from 2.0, @cre8ivepark removed UnityUI from the examples hub for this reason. Removing release blocker.
I have a hacky 'fix' here. More of a partial investigation. It shows what functions need to be called to get it working again after switching scenes. But I haven't figured out when to do those things. As in, what event or where in code should I trigger the execution of those things.
@AdamMitchell-ms Have you checked in your "hack"? What does your hack involve? I just tested the latest and the UI elements still don't seem to work.
@AdamMitchell-ms Have you checked in your "hack"? What does your hack involve? I just tested the latest and the UI elements still don't seem to work.
+1. Adam if you could please share your workaround then perhaps somebody can take it over / look further. Thank you so much for investigating!
@sostel and @julenka,
I've dropped this investigation and don't have time to pursue it at this time. But here are my changes if someone wants to pick them up.
With those changes, after switching scenes, I would add an InputModuleReactivate anywhere in the scene, which would then call MixedRealityInputModule.Reactivate(). Then Unity UI input would work again.
The next steps would be determine when to call this properly. We'd need to find an event or function that fires at the right time to call it. You can see I had tried a few places in my changes, but none of them had worked yet.
when switching profiles, the pointing ray is going through the unity ui panel. it is as if the panel has lost it's layer or something similar
Will Unity UI continue to be supported moving forward? I ask because besides running into this issue myself, this porting guide suggests "Rebuild canvas-based UI with quads, colliders, and TextMeshPro text". Sometimes we just need a simple flat button UI without all the added bells and whistles (themes, 3d animations, multiple interaction types, etc).
This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.