Hi all,
I’m working on an AR project, and some of the more polygon heavy objects that I spawn on planes are constantly moving with the camera.
The highest polygon object has around 300K vertices, and the lowest one is a default cylinder. Another prefab is a collection of models, where all have around 150k verts together. In that case, one out of the two models sticks in place, while the other one moves as if parented to the session origin. The two models are identical.
The 300K model moves the same way, as if it was parented to the AR session origin.
Out of everything tested, the only spawned object that doesn’t move is the default cylinder.
In terms of performance, there’s no hit, no matter the object. I’ve checked the fps, and in any case, the frame rate was always 60. In fact, it’s locked to 60 (I guess that’s the camera’s FPS) with every object spawned.
I’ve tried using an ARAnchor, both by adding it via a script and by manually adding it in the editor, on each prefab. I’ve also added an AR Anchor manager on the AR session origin component. The AR Anchor has no effect. I’m not even sure I’ve set it up correctly, although I’ve followed the documentation.
All prefabs (including the default cylinder) have an empty game object as parent.
I’ve also tried scaling the objects down (as some were purposefully large) and that didn’t have any effect either.
I’m using unity 2020.3.30f1, and AR foundation version 4.1.13.
In terms of testing grounds- a well lit room.
My phone is a Pixel 5.
What else can I try and do?
Thanks a lot!
Ok so this problem isn’t fixed at all, but I found its cause.
Apparently, it happens when objects are larger than the plane itself . Its not very clear why, but I guess that if most of an object’s mesh doesn’t touch the plane, the object’s placement gets ‘lost’.
I think the digital-physical connection gets broken, and unity can’t figure out the models position in relation to the simulated camera’s position, because it looses connection to its anchor point. Again, pure speculation.
I still don’t fully understand why this happens, but it does, and it can be seen more clearly using Vuforia’s plane detection system. Since it visualizes the 1 meter by 1 meter square that is created as an anchor, through trial and error I’ve found, that the more of an object’s mesh sits ‘outside’ that square, the easier it is for that object to get ‘lost’. If it is symmetrically out of bounds (i.e completely bigger than or encapsulates the entire plane) it just doesn’t seem to get anchored at all.
This limitation isn’t really brought up anywhere, and I’ve only found it through trial and error, and by seeing that some companies offer paid services for specifically “Large AR model placements”.
I’ve tried attaching a “leg” object that literally anchors the model to the center of the plane, and even after joining everything into a single mesh in blender, the leg stayed in place, while any other part of the model kept floating as normal, which is super weird.
Another thing is that using Unity’s AR foundation, nothing seemed to help. Not even making the model to be as small as a default cube. Nothing made it stick in place, no matter what, even though Vofuria managed to keep it in place just fine at a smaller-than-plane size.
Hi @SassyPantsy ,
We’re unaware of any tracking issues related to scale or position of objects relative to anchors. Can you please file a bug with your repro case?