Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

ARKit 2 and MultiPeer Connectivity to share anchors

Discussion in 'ARKit' started by T1nk35B3ll, Sep 27, 2018.

  1. T1nk35B3ll

    T1nk35B3ll

    Joined:
    Aug 22, 2017
    Posts:
    2
    I'm trying to share an anchor between two devices.
    All the examples show that we can share the WorldMap, using the serialized format of the ARWorldMap, but I don't understand how I can get the anchors from the ARWorldMap to render these anchors on the other device.

    I use the MultiPeer Connectivity feature. I am able to share the ARWorldMap.
    Reading the Apple's documentation, the ARSession contains the anchors saved in the map. Each anchor should have a name property that we could use to determine which 3D model to display when we resume a session.
    Regarding the Unity plugin, I don't find a way to get those anchors.

    Can someone could enlighten me ?

    For the info : Unity 2018.2.7 + iPhone 7 and iPhone X both on iOS 12, MultiPeer Connectivity plugin from Prime 31
     
  2. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    114
    this is currently not supported by the plugin. You could add that functionality to the plugin or share a dictionary consisting of anchor identifiers and descriptions when you share the map
     
  3. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    729
    I'm not sure this is true - ARWorldMap contains any user anchors too I believe. I haven't tried this myself, but if you add user anchors before you save the ARWorldMap, when you load ARWorldMap and it relocalizes, you should get your ARUserAnchorAdded callbacks for every user anchor that was saved.
     
  4. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    114
    that's true but the anchors have a random identifier, so you can't tell what that anchor represents unless you save and synchronize that meta data
     
  5. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    729
    You are right dangit! User anchors have a name field that you can provide, but the plugin does not use the initWithName:transform method to create anchors. Feature request?
     
  6. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    729