ARFoundation ApplyWorldMap - MakeContentAppearAt Issue

Hey,

I’m currently trying to align an object correctly on two separate devices.

I’ve got both devices networked, the client device successfully downloads and applies the uploaded WorldMap - everything lines up perfectly, I am using an ARReferencePoint to share the position of the ‘placement object’ I am lining up.

I attempt to ‘MakeContentAppearAt’ on both devices when the setup phase of the AR session is complete. At this point for whatever reason I cannot get the same behaviour on both even though they are calling the same code, and printing out whilst running the session on each device tells me they are both using the same ARReferencePoint.Transform for ‘MakeContentAppearAt’.

Here is the code that runs on both host and client devices once the AR WorldMap has been successfully applied

// position the content
sessionManager.sessionOrigin.MakeContentAppearAt
(
    map.transform,
    mapARReferencePoint.transform.position,
    mapARReferencePoint.transform.rotation
);

// scale world data
sessionManager.sessionOrigin.transform.localScale = Vector3.one * scaleFactor;

Any help or suggestions would be greatly appreciated!

Thanks,
Joe

1 Like

So I’ve finally figured it out. I originally assumed the root problem was related to the scaling of the content via MakeContentAppearAt() - this is not the case.

I wrote my own scaler code to make double sure and this was also not aligning correctly, it would be the wrong position, rotation or it would drift over a period of time.

Shortly after the scale code is executed I disable the ARPlaneManager ( as I no longer need it to cast against in the scene )

If you disable the ARPlaneManager - any ARReferencePoint objects will lose their anchoring and begin to drift, change position or rotation.

It turns out they are linked together although I hadn’t found this mentioned in the documentation and so it was a single line of code I blindly ignored. I assumed a reference point would calculate its position based off known points surrounding it rather than be tethered directly to a plane?

Anyway hopefully this helps someone!

3 Likes