Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Issue with "Use Azure Spatial Anchors to anchor objects in the real world" tutorial - ParentAnchor still moves after creating Azure anchor #82

Open
roalchaq opened this issue Nov 9, 2023 · 1 comment

Comments

@roalchaq
Copy link

roalchaq commented Nov 9, 2023

Hi there, I followed the tutorial here: https://learn.microsoft.com/en-us/training/modules/azure-spatial-anchors-tutorials/

Everything work correctly except that after creating an Azure anchor, the expected behavior would be that the "ParentAnchor" gameobject won't move unless you press the "Remove Local Anchor" button. However, after creating the anchor, "ParentAnchor" can still be moved. Following the "CreateAzureAnchor" method from AnchorModuleScript.cs, I see that an ARAnchor is added to the gameobject as part of cloudNativeAnchor.NativeToCloud(). I understand this should be enough to fix the gameobject in place. Am I missing something?

@roalchaq
Copy link
Author

I don't know if this is relevant but I found that, when using the SaveAzureAnchorIdToDisk and GetAzureAnchorIdFromDisk from AnchorModuleScript without creating an anchor first I get the following error: "ArgumentNullException: Value cannot be null\n Parameter name: cloudAnchor". To fix the error, I added the following to CloudManager_AnchorLocated (at the beginning of the first else statement):

if (currentCloudAnchor == null)
{
    currentCloudAnchor = args.Anchor;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants