While building an app for the HoloLens 2 in Unity 2019, I started using MRTK (Mixed Reality Toolkit). I repeatedly ran into problems where the app would work perfectly, as expected in Unity while running the game preview. Once I built and deployed the app to an actual HoloLens 2, however, it would not run correctly.
At first, the app was in a window similarly to here. Then, once the window was removed, the app moved as if it was stuck to the user's face instead of staying still as the user moved around it. Finally, the hand and arm recognition did not work.
I followed all of the code examples, and I know my scripts are working because they work as expected in Unity. So what is wrong? Why does the app work in Unity but not on the HoloLens itself?