How do I display multiple types of Wayspot Anchors in the location of the screen I touch?

  • Issue category: VPS
  • Device type & OS version: iphone11 pro / iOS 15.5
  • Host machine & OS version: macOS Monterey version 12.4
  • Issue Environment : On Device
  • Xcode version: 13.4
  • ARDK version: 2.0.0
  • Unity version: 2020.3.35f1

Description of the issue: How do I display multiple types of Wayspot Anchors in the location of the screen I touch?

Hello Noriko,

If you’d like to Instantiate different types of Wayspot Anchors, you can create an array with multiple objects that will Instantiate with each touch and assign them in the Inspector. You could also try using Lists to accomplish this.

Please see the Unity Scripting API and Unity Learn documentation for more information on arrays and lists. Thank you!

I instantiated different types of Wayspot Anchors, created an array with multiple objects that are instantiated each time they are touched, and assigned them in the inspector.

Then, using the “Gift Button” and “Balloon Button”, you can switch between the objects in the ObjectHolder so that a different object is displayed each time you touch it! The “Gift Button” and “Balloon Button” are used to switch between objects in the ObjectHolder so that a different object appears each time it is touched.
However, when I press “SAVE Button” → “LOAD Button” to load the Anchor again, the last object in the ObjectHolder that I switched to is replaced by all Anchor has been replaced by the object in the last switched ObjectHolder.

Please let me know how to solve this problem.

I am attaching the url of the video where the problem occurred.
Thank you in advance.

Hello Noriko,

Thank you for the video! I’m glad you’re able to successfully switch between objects!

Each object is assigned an anchor ID when it’s created. We know these IDs are properly recognized when you click the ‘LOAD’ button because they appear in the Hierarchy, but it looks like they are not associated with a specific object type. Instead, only the object that was last selected is being loaded.

The code would need to be set up to also recognize the object type. This would allow you to properly save and load each object type rather than only what was last selected. You could look at the WayspotAnchorController script where each anchor is created/loaded to add this functionality.

Please let me know if you have any more questions regarding this matter. Thank you!

[Each object is assigned an anchor ID when it is created. These IDs appear in the hierarchy when you click on the “LOAD” button, so you know they are recognized correctly, but they don’t seem to be associated with a specific object type].
I was informed of the problem.
However, I am not sure how to [anchor ID] and [associate with a specific object type] due to my inability to do so.
Please tell me.

Hello Noriko,

You can look at the WayspotAnchorDataUtility class for guidance on saving and loading data. This is where you would need to tell the code to associate certain wayspot anchor IDs with certain game objects. Unfortunately, we don’t currently support adding custom information within WayspotAnchorsData, so this would be something developers would need to implement on their own.