Image Tracking Documentation - Instantiating and positioning objects

Hi Folks,

I have set up a scene with image tracking which places a 3d object when the image is detected. But, I am currently doing this using the TrackedImagePrefab. According to the documentation this is bad, and what I should be doing is:

“If you would like to instantiate content at the pose of the detected image and have its pose updated automatically, then you should parent your content to the ARTrackedImage”

I don’t really understand how to do this. Where do I access ARTrackedImage? How would I then position my object so that it’s left/back corner is in line with the left/back corner of the tracked image?

Any help much appreciated.

Gary

1 Like

Still on this…

Trying to do :
myObject.transform.SetParent(trackedImageManager.trackedImagePrefab.transform);

Returns an error of:
Cannot instantiate objects with a parent which is persistent.

Please refer to the following sample for best practices for placing various AR content using image tracking.

You can also refer to the following lines of code for reference when trying to scale to real world image size.