positioning of prefabs in AR foundation Image Tracking

Hey all

I am currently working with Image tracking component of ARfoundation and continuously facing this issue

I want to track a QR code and then load a prefab in a particular orientation wrt to that QR.The problem is whenever i try to set my prefab transform according to the my requirements it does not reflect the same in the app also it resets the transform of my prefab every time and places it in the center of QR.

I looked over various tutorials on Youtube and didnt find any helpful resource regarding orientation of prefab, all just seem to load the model over the target as it is.

Is there any way/demonstration to address my problem ? In Vuforia we have an option to place object wrt to Image Target in the unity editor itself but i dont know how to do that here.

I tried few ways to this and got to know that scaling is working as intended (but i still dont know is the relation between target size and scale of object) but position and rotation are not working.

Unity 2019.3.12f , ARF = 3.0.0

Please help !!

2 Likes

I ran into the same problem and could not find any any solution so far either.

I tried the AR Foundation Demos Project from Github and it seems as ARTrackedImageManager.cs overwrites the rotation of my prefab. For some reason it expects all images to be positioned on a horizontal plane but when the tracked image is hanging on a wall the prefab starts to turn in wierd ways.

I’m using Unity 2020.3 (LTS) and ARF = 4.1.5

well as it turns out there was a script called “Number Manager” on the loaded prefab that added a rotation constraint in order to rotate the prefab towards the camera. All i had to do is to deactivate this script and rotate the mesh inside of the prefab. Rotating the prefab itself doesn’t have any effect.

Dear Dansopanso, after deleting that piece of code, you were able to instantiate a prefab model at a custom distance to the image ? Thanks in advance !

Where did you find the number Manager script