How do I place multiple similar objects on a map without spawners for every object type?

Include the following details (edit as applicable):

  • Issue category: Lightship Maps
  • Device type & OS version: Android
  • Host machine & OS version: Windows
  • ARDK version:
  • Unity version:

Description of the issue: I’m working on an AR game which uses Niantic Lightship maps in Unity and I’m trying to place objects on the map. The game allows users to interact with virtual birds in their area. I’m working on the logic to spawn the birds and in the sample structure project, there are different spawners for each type of building. Since there are so many types of birds, it would be a lot of duplication to have bird spawners for every type of bird which could be hundreds. Ideally, I’d like to have one generic bird spawner that determines the bird prefab at runtime. Is this possible or is there a better approach?

The code I’m basing this off of in the sample project is located at:
\Assets\Samples\Lightship Maps SDK\0.4.0\Map-Based Resource Game\Scripts\MapGameMapInteractions.cs

Hi there,

The Map-Based Resource Game demonstrates one way to place objects and shouldn’t be looked at as the only way to place objects. For something like what you’re building, you could strip away the switch statement and have the code call some kind of custom bird spawning manager that takes on the responsibility of determining which bird to spawn. Of course, you would want to pass the rotation and geographical coordinates to the function that handles bird spawning.

Let me know if you have any other questions or concerns!

Kind regards,
Maverick L.