How to load ASA in a new Unity Project

ARNAUD 16 Reputation points
2022-01-24T09:37:16.8+00:00

Hello, I've been reading through the documentation of Azure Spatial Anchors and I'm a bit confused about how you re-use an ASA in a new Unity project.

I don't understand is how do you load an ASA in your Unity UI to be the reference location of a prefab for instance?

All I found in the ASA documentation is how you can 'locate and ASA' once it's been created. Nowhere do they talk about loading an ASA in a completely new Unity project you're designing in which you want to have a geographical persistent location for a prefab.

Thanks for any help.

Azure Spatial Anchors
Azure Spatial Anchors
An Azure service that is used to build immersive three-dimensional applications and experiences that map, persist, and restore content or points of interest at real-world scale.
86 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Patrick Misteli 91 Reputation points Microsoft Employee
    2022-01-26T15:28:50.02+00:00

    Hi @ARNAUD

    Thank you for your feedback. We have recently updated the HL2 tutorial and point out the use of different devices here (link)

    In short: You need a device to create an anchor. From your post it seems like you've done that. Whenever you successfully create an anchor you will be given an Anchor ID back by the service as a response.

    Given this Anchor ID (and the appropriate authorization to your ASA Service on Azure) any device can now create a watcher and find this Anchor. In the sample app, as well as in the tutorial linked above, this is simulated by shutting down the session. Starting a new session and looking for the anchors again.

    What you could also do to test things out is to

    1. Device A: create an anchor
    2. Device A: receive the Anchor ID from the service (after successfully creating the anchor)
    3. Device A: Send this ID to Device B
    4. Device B: Create a session + a watcher with the Anchor ID

    Device B will then find the anchor at this position. It is not necessary to create a visual game object at this anchor, however the Tutorial will create one to make it visually easier to follow

    1 person found this answer helpful.

  2. ARNAUD 16 Reputation points
    2022-01-28T21:57:57.727+00:00

    What do you think of that solution? They seem to be able to get some data out of the ASA scanning process through some JSON files that they download after the initial scanning stage: https://assetstore.unity.com/packages/tools/integration/easy-ar-spatial-anchors-with-azure-cloud-208782

    Here is an example of what we get out of these JSON files

    That's an example of what we're able to get out of this JSON file after creating the ASAs

    1 person found this answer helpful.

  3. António Sérgio Azevedo 7,661 Reputation points Microsoft Employee
    2022-01-25T12:18:42.033+00:00

    Hi @ARNAUD ,
    Sorry to hear you are confused with the documentation you have read so far. Would help if you can share the docs you have been looking at.

    I am nevertheless sharing the following which I believe can help clarify your current questions:

    1) Building in Unity with Azure Spatial Anchors

    Developers can choose Unity for creating and deploying mixed reality applications that use Azure Spatial Anchors. If creating your own project, follow the Unity project setup guide. Otherwise, you can get started quickly with one of the following Quickstarts:

    2) Configuring Azure Spatial Anchors in a Unity project

    This guide will show you how to get started with the Azure Spatial Anchors SDK in your Unity project.

    Let me know if these two docs can help clarify and help you proceed with your project?

    Thank you!

    Remember:

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification.