gubendran_vins
14 days agoHonored Guest
MRUK: Object not automatically placed on floor in Meta XR SDK 78
Hi everyone,
I am working on a Mixed Reality project using Meta XR SDK v78 with MR Utility Kit (MRUK) in Unity 6000.0.55f1
I want to automatically place a 3D machine model on the real-world floor when the scene loads.
However, the object stays floating in mid-air instead of being positioned on the detected floor surface.
Here’s the code I tried:
var room = MRUK.Instance.GetCurrentRoom();
if (room != null)
{
var anchor = room.GetSurface(MRUKAnchor.SceneLabels.FLOOR);
if (anchor != null)
{
transform.position = anchor.transform.position;
transform.rotation = anchor.transform.rotation;
}
}But, this does not align with the real world in the floor it is in the mid air please let me know to how to fix this.
Thanks in advance.