Touching Camera Rig requires Unity restart

Anytime I make a change in the Magic Leap Camera Rig I have to restart the Unity editor otherwise my controller is in the wrong location and head tracking stops working. Anyone else having this?

Unity Editor version: 2023
ML2 OS version: Current
MLSDK version: Current

Hi @rob42lou,

Thank you for reaching out regarding this issue. Are you referring to the XR Rig prefab in the Magic Leap XR Unity package? Also are you experiencing the controller location being incorrect in a build or in the simulator? Also, are you moving the root object?




Yes the XR Rig Prefab in the Unity package. And it's in the build, I haven't tested using the simulator. And no I am not moving the root object.

What happens is I'll launch the app on the Magic Leap 2 and nothing moves when you rotate your head. Whatever is on screen remains on screen in the same place. The only reason I mention the controller is because while this is happening the xr ray line is a good foot or so above me, it does move though when I move the controller, and the ray also interacts with UI and everything.

Just to be clear about your problem, the issue is that if you don't restart the Unity Editor before building, the objects in the scene do not change position in world space and the XR Ray line is displaced above the location of the actual controller? Are the scene objects always in your view no matter how you rotate your head?

That's correct, but only if I change something in the Magic Leap XR Rig. And yes the scene objects are always in my view regardless of head orientation. It's like it's breaking the head tracking script.

Would it be possible to provide a unity scene that can reproduce this issue? If not, what are the steps needed to reproduce this?



Sure. In the Magic Leap Unity Examples open up any scene, then move the GameController in the XR Rig slightly (or change anything else). Save then run. You'll see it no longer works properly.

I'm not able to reproduce this issue locally. Are you sure that nothing else has been changed? I tried multiple scenes in the examples project and they were functional. Could you try starting a fresh project?

I can try, but I was doing this in the Magic Leap 2 sample project. Did you try changing things inside the actual prefab itself?

I tried moving the position of the GameController slightly. Let me give it a few more tries.

What is the exact version of Unity 2023 that you're using. This might help isolate the issue.

It happens in both 2022.2.18f1 and 2023.1.0f1 for me. A good example of something that breaks it for me is adding a controller model to it and then adding that to the game controller.

Hmm. It seems I cannot reproduce this bug. Would you be able to capture a video of the issue so that I can send it to the team? And perhaps a screenshot of the changes you're making that triggers this?