Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Behaviour when an ARTrackedImage goes off screen

Discussion in 'AR' started by marcogillies, Nov 25, 2022.

  1. marcogillies

    marcogillies

    Joined:
    Jun 22, 2017
    Posts:
    2
    Hello, I am teaching a class using ARFoundation and am getting confused by the behaviour of 3D prefabs when an ARTrackedImage goes off screen (or otherwise isn't tracked).

    In my project (and other projects) tested on iOS/ARKit the instantiated prefab stays visible and remains in the correct position in (real) world space even if the tracked images is out of shot.

    However, one group of students is building a (different) project using Android/ARCore and in their example, the prefab is still visible, but is no longer fixed in world space, instead it seem fixed in screen space ("stuck to the screen").

    Does anyone know if this is a platform difference between ARKit and ARCore?
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,018
    There are platform differences between ARKit and ARCore, but the issue here is not that the prefab is stuck in screen space. The prefab is definitely in world space, but you may be observing a tracking error.

    Our docs give two relevant pieces of information: you should check the image's tracking state, and possibly consider comparing the image transform with your camera's view frustum to help detect if the image is in or out of frame. This might help your students intelligently show and hide their prefab. (We do not disable the image GameObject by default, for instance, if its tracking state is set to Limited, but you might want to depending on your needs.)
     
  3. marcogillies

    marcogillies

    Joined:
    Jun 22, 2017
    Posts:
    2
    Thanks a lot for your help!
     
    andyb-unity likes this.