Search Unity

Question Lock Spawned GameObjects' position

Discussion in 'AR' started by acandael, May 17, 2022.

  1. acandael

    acandael

    Joined:
    Apr 7, 2021
    Posts:
    74
    Hello,

    I am using ARFoundation to track a QR code and instantiate an object on top of it. This works fine, but the instantiated object is sometimes subject to sudden shift or rotation although the QR code hasn't moved. Or sometimes is a bit 'trembling'. Therefore, since in my case the QR code is not gonna be moving, I'd like to find a way to lock its position/rotation once and for all.

    How could I achieve that, so that the GameObject doesn't move at all anymore?

    Is it possible that the problem comes from the camera position, that is not correctly evaluated at all times?

    Thanks a lot,
    Arnaud.
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    If the QR code does not need to be actively tracked, you can disable the TrackedImageManager to stop image tracking once the image has been detected.
     
  3. FernwehSmith

    FernwehSmith

    Joined:
    Jan 31, 2022
    Posts:
    36
    Have a look at the anchors section in the documentation. Sounds like that might be what you need
     
    acandael likes this.
  4. acandael

    acandael

    Joined:
    Apr 7, 2021
    Posts:
    74
    I'll look into that. Thank you guys!