Multiple image targets?

Include the following details (edit as applicable):

  • Issue category: Lightship Maps / Semantic Segmentation / Multiplayer / Real-time Mapping-Depth / ARDK Documentation / Unity Example Package / Sample App aka ‘AR Voyage’ / ARDK Virtual Studio Tools / Developer Tools / Networking / VPS / Scanning Framework
  • Device type & OS version: Android / iOS / Other Ex. iPhone 8+ on iOS 13
  • Host machine & OS version: Mac / Windows / Linux / Other Ex. Mac on Big Sur x.x
  • Issue Environment : Unity Remote / Unity Mock / On Device / Dev Portal
  • Xcode version:
  • ARDK version:
  • Unity version:

Description of the issue: I was wondering is there a way to track multiple images with each image having its object (Image 1 has a cube and Image 2 has a sphere) while using Unity.

Hi Dominik,

Yes you sure can! On our Detecting Images page, we have a sample script that demonstrates how you would attach a prefab on top of a detected image in the camera feed. You could change what prefab is used for what image by using the IARImageAnchor.ReferenceImage.Name. Specific implementation details will vary based on your use case – but I encourage you to give the sample script a try and experiment with an if statement inside of the AnchorsAdded method to change what image gets what prefab. You might also have to tweak the UpdatePlaneTransform method to ensure that the game object is scaled correctly. The entire page is a great starting point if you’re unsure of any of the terminology or how to set everything up in Lightship.

Kind Regards,
Maverick L.

1 Like