Skip to main content
New Participant
October 31, 2025
Question

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.

2 replies

Meta Employee
November 3, 2025

Hey gubendran_vins!

I'm sorry to hear that you're having trouble getting your object to spawn in the right place, I understand how that could be irritating. Regarding the issue you mentioned, my first suggestion would be to use the MRUK surface utilities to find the closest point on the detected floor surface. If the anchor's origin is misplaced and you've set the object's transform to the anchor's transform, it's possible that the anchor's pose is offset from the real floor and the object won't spawn in the place you want.

If you're still having trouble getting the object to spawn in the right place, you could also try using the Environment Raycasting API to more precisely place your object. We have some great documentation that covers each of these topics, and I can link the pages below. 

Hope this helps, and please feel free to let me know if you have any questions or need any more help!

Spatial Anchors
Mixed Reality Utility Kit – Manage and query scene data
Mixed Reality Utility Kit – Place content with scene data
Mixed Reality Utility Kit – Instant placement with Environment Raycasting API

-G

Participant
November 11, 2025

Hi gubendran_vins​ ! I've faced a similar problem based on my past experience with MRUK anchor placement. The solution I've recalled is to make sure that the pivot origin of your 3D machine model is at the exact lowest centre of the base.

Let us know again whether this solves your problem - if so, you can mark as solved! 😄