Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Bug Accessing ARSession nativePtr and setting it's delegate breaks things in ARFoundation in unity

Discussion in 'AR' started by boruds, Apr 12, 2021.

  1. boruds

    boruds

    Joined:
    Aug 7, 2020
    Posts:
    28
    I am building a native iOS plugin in which I want to handle native ARSession events from ARKit,
    I pass the ARSession nativePtr to the plugin once the session is initialized in Unity.
    Then in my plugin I set the ARSession delegate to the class I have defined in my plugin.
    On setting the delegate, I get the the callback fired for session didUpdateFrame, didAddAnchor, didUpdateAnchor, didRemoveAnchor delegate methods, but in Unity things are broken, I don't see the mesh on setting the delegate, the planes get added but they don't get updated,

    Any reason why this could be happening.

    Can I do something to get the native ARSession delegate callback events from ARKit without breaking things in unity?
     
  2. boruds

    boruds

    Joined:
    Aug 7, 2020
    Posts:
    28
  3. boruds

    boruds

    Joined:
    Aug 7, 2020
    Posts:
    28
  4. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,698
    Some info from the team:

    The Unity ARKit package relies on those callbacks to feed data to AR Foundation. If you alter those delegates, AR Foundation will stop receiving updates from ARKit.
     
unityunity