AR Foundation - Make image tracking object glued in the world

Hello!

Is it possible that when I scan a picture from the library and then spawn an object on it. To leave this object in the world forever. So the position and rotation should no longer be updated.

I want to try this because I now experience a lot of jitters when I spawn an object using image tracking. My image target is fixed in the real world so it never moves. That's why I don't see the point of constantly updating the transform.

Hopefully, someone can help me with this.

Make a button that starts a scan, then end the scan like 10seconds later.

Start Scan
arOrigin.GetComponent().enabled = true;
arOrigin.GetComponent().enabled = true;
arTrackedImageManager.trackedImagesChanged += OnImageChanged;

End Scan
arOrigin.GetComponent().enabled = false;
arOrigin.GetComponent().enabled = false;
arTrackedImageManager.trackedImagesChanged -= OnImageChanged;

You should add a new anchor to the world-space location when the image is first detected.
https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/anchor-manager.html#adding-and-removing-anchors

2 Likes

[quote=“todds_unity”, post:3, topic: 875301]
You should add a new anchor to the world-space location when the image is first detected.
https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/anchor-manager.html#adding-and-removing-anchors
[/quote]

how would you know when the image is detected. I want to call an event whenever the image is detected and lost.

https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.0/manual/features/image-tracking.html#respond-to-detected-images