Skip to content

Solution for quickly destroying and re-creating Meta spatial anchors associated with Unity GameObjects positions in space

License

Notifications You must be signed in to change notification settings

alexp66/Dynamic-Spatial-Anchors-for-Meta-SDK-Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Dynamic-Spatial-Anchors-for-Meta-SDK-Unity

Solution for quickly destroying and re-creating Meta spatial anchors associated with Unity GameObjects positions in space

Once a Meta spatial anchor is created, it can't be moved. This solution deletes and re-adds a GameObject's associated SpatialAnchor, as well as re-serializes the list of anchors uuids.

For the most relevant code, skip to on OnHandGrab(), and OnHandRelease() methods.

A common use case would be for when a user grabs and releases an object, respectivelly.

Note I used Odin Serializer for the serialization, if you prefer to use Unity serialization, simply modify the LoadSavedAnchorsUUIDs() and SaveAllActiveAnchorUUIDs() methods.

About

Solution for quickly destroying and re-creating Meta spatial anchors associated with Unity GameObjects positions in space

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages