Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

ARFoundation iOS breaks with ARPlanemanager

Discussion in 'AR' started by Christop, Sep 26, 2019.

  1. Christop

    Christop

    Joined:
    Aug 21, 2012
    Posts:
    60
    Hi
    I am trying to follow this tutorial (
    )
    In there the guy for IOS just instantiates a ARSession and ARSessionOrigin and by adding a ARRaycastManager (update i added from the comments since he used an older arfoundation), his code works.

    Most ARFoundation videos and tuts mention that an ARPlaneManager should be attached to ARSessionOrigin in order to create the planes (this is also mandatory its seems for using ARFoundation on Android).
    How does IOS ARFoundation work without it in this example?

    What is even more strange is that as soon as i add a ARPlaneManager to ARSessionOrigin the example does not work right anymore for IOS. The Placement indicator gets stuck always at the height of the last plane and does not work right. Even if i provide a plane prefab.

    Do we have to make something special when adding the ARPlaneManager component? Is it needed for IOS? Does it work on IOS?

    (Unity 2019.2.6, ARFoundation 2.0.2, ARKit XR Plugin 2.0.1)
    Thanks
    Dimi
     
  2. Christop

    Christop

    Joined:
    Aug 21, 2012
    Posts:
    60
    I wonder why none has stumbled upon this? Maybe because i work on a tight space and ARKit picks up something.
    Anyway i got it working on IOS with ARPlaneManager replacing the TrackableType from TrackableType.Planes to TrackableType.PlaneWithinPolygon when i do a raycast

    raycastManager.Raycast(screenCenter, hits, TrackableType.Planes)
    vs
    raycastManager.Raycast(screenCenter, hits, TrackableType.PlaneWithinPolygon)

    So what doesARFoundation default to on IOS when no PlaneManager is used? I still don't understand why recasting has a different behaviour on iOS when there is a ARPlaneManager is present or not.
     
  3. Christop

    Christop

    Joined:
    Aug 21, 2012
    Posts:
    60