Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.03k stars 1.13k forks source link

Persistent ARAnchor trackable ID? #643

Closed yosun closed 3 years ago

yosun commented 3 years ago

How do I identify a particular ARAnchor trackable ID that has been saved, loading it after the session has ended? It seems trackableID is session dependent... Is there a universal ID?

tdmowrer commented 3 years ago

If you are talking specifically about anchors that are loaded as part of an ARWorldMap, the trackableId will be the same as it was when you saved the map. (This is currently the only way to persist anchors of any kind in ARFoundation, so I assume that is what you mean.)

yosun commented 3 years ago

In the documentation it says the trackableID is session dependent, so I assume it resets every session?

tdmowrer commented 3 years ago

In general all we can guarantee is that trackableIds are unique to a session, but for ARWorldMaps specifically the IDs do not change between sessions.

In the ARKit package, the trackableId is generated from the ARAnchor's identifier property in Objective-C. These do not change when loaded from a world map.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.