Large objects sliding in XR-Foundation/ARCore

I’m making an AR application that has to place large prefabs (50m x 50m buildings) at specific GPS locations. The placement of the prefabs is fine, but tracking isn’t. When moving around/towards the object, it appears to be sliding - the actual effect looks like the ground is moving faster than the object.

I’ve tried using anchors by adding the ARAnchorManager to XR Origin, creating an ARAnchor during Start and then setting the anchor transform as the parent of the instantiated objects. This had no noticeable effect and the objects continued to slide.

I also tested the anchoring with a small object that I had dragged and dropped into the editor and there it worked fine. (The anchor was added in the same way.)

Am I using the anchors wrong or do they not work at larger distances or on larger objects?

Which phone is this?
ARCore doesn’t have the best tracking. ARKit on Ios seems more stable.

Having a good phone does help. I also heard that the latest AR foundation+ ARCore in Unity 6 is more stable. That’s definitely worth a shot!

I’m using a OnePlus 11 5G. I am unfortunately limited to the device, so ARKit isn’t an option.

I tried upgrading to Unity 6, but the drifting is still persistent.

I am instantiating an object like so:

        GameObject pPrefab = Instantiate(bType1, new Vector3(-2, 0, 3), Quaternion.identity);
        
        ARAnchor anchor = GetComponent<ARAnchor>();
        if (anchor != null)
        {
            pPrefab.transform.SetParent(anchor.transform);
        }

The ARAnchorManager is attached to XR Origin.

The actual anchoring is very inconsistent though. Even with small and near objects, it only anchors them sometimes. Other times they keep drifting.

So, am I just using anchors wrong?

The app I’m making is supposed to place objects in world space based on GPS coordinates, so plane detection shouldn’t really be necessary and might not even be possible when placing objects up to 60m away. Is it possible to attach an anchor to XR Origin?

Possibly, because AR Foundation 6 introduces this feature:

Did you try to use Geospatial API?