How to set position of an gameobject that is spawned using Image Tracker in AR Foundation

Hello.
I am developing a scene where a fbx model will be spawned after tracking an image. But the issue is that it is spawned keeping the image and the model center same point which I don’t want. I want to set the model according the desirable location respect to the image marker.

Will it be possible?

Share the code you already have for the image tracking.

Everything is possible (;

I haven’t written any code. It is the inbuilt feature script of AR Foundation named as “AR Tracked Image Manager”.

normally i build dummy marker on the 0,0,0 position (to compare its location when spawned),
then offset the model inside prefab to correct position (based on that 0,0,0).

its quite annoying process and even more when you have markers on the wall,
then in your prefab the rotation needs to be handled manually too…

compared to vuforia where it was easier…

I was using Vuforia but with that I have size issues. The size of the model that is shown in AR is way bigger than the model that was made. If you know how to resize the model in vuforia, it will be helpful

in vuforia the size depends on the marker size or some other scale, already forgot where.
but should be in their docs.

what I read, it was based on camera distance or something. but it didn’t worked either.

should be this one,
https://forum.unity.com/threads/vuforia-image-target-size.648412/#post-4361758

Ok, I’ll try this but won’t it be hassle to change the size of the image marker every time I use a new model?

if model is correct scale already, it shouldn’t matter.
(but not sure, i always used fixed size A4 marker and printed marker was A4 same size)

I have tried this method but the model is fluctuating and if I try to spawn other object(which is required) it is also fluctuation like crazy.

yeah AR tracking is still pretty bad in most cases…
(even on latest ipad Lidars the model doesn’t stay on place when moving)

It was working well without the model addition but it crashed after changing the image marker size…:(:frowning:
And I’m using iPad just for this only…

I am working on a similar project, so if I understood correctly you only use the A4 for the size scale and not attach the object to it?
What I want to do is to spawn the object relative to an A4 to scale 1:1 real life and then attach to that place but I want it to be movable. The problem using AR Image Tracker is that the prefab gets destroyed when the trigger reference image is not in the scene anymore. How can I do that would you suggest?

i moved objects with offset tools (using UI),
which then searched for my trackableobject in scene, if available,
moved the child transform (not the root prefab transform).
(so the tracking & object placement comes from Image and extended tracking, but user can offset model manually, and can save/load the offset if needed)

not sure if thats the best way, but works…

1 Like

Whenever I have used AR Image Tracker, none of my model got destroyed though it has moved from its position now and then. Maybe there is some code that you have written or selected some settings that destroys the model when you move the screen away from the image.

1 Like

Thanks I rechecked and yes you are right I delete the prefab whe nthe ref iamge is out of screen. And now to modify I will adjust the x,y,z of the prefab acxcordingly getting touch inputs hopefully!

Happy, that it helped. :slight_smile:

Yeah I have problems with my rotation. Everytime i scan an Image the image has a different rotation! Any Tipps for that?

Do you guys recommend using vuforia. I have some projects now i need to work with AR und stable positioning and Rotation of the AR Objects is really important. ARCore and ARFoundation seems to buggy or I don’t know how to position them properly. I’m using anchors for my prefab but still get some sliding.