Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Swap Mars Marker Library at runtime?

Discussion in 'Unity MARS' started by cam415, Jun 4, 2020.

  1. cam415

    cam415

    Joined:
    Mar 26, 2014
    Posts:
    46
    Hello,
    When using image tracking markers, is it possible to swap one "Mars Marker Library" (located on the Mars Session script with another at runtime? Any guidance would be greatly appreciated. Thanks
     
  2. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    Hello @cam415

    You can only have one Mars Marker Library per scene and is not possible to hot-swap libraries at runtime in MARS. But you can definitely have different marker libraries between scenes. May I ask what are you trying to accomplish?
     
    Last edited: Jun 4, 2020
  3. cam415

    cam415

    Joined:
    Mar 26, 2014
    Posts:
    46
    Thanks @jmunozarUTech. I will try doing scene changes then.
    I am working on an installation that consists of one massive mural sized image made up of many smaller trackable images. Viewers are requested to input an image ID to view a specific section of the larger image. I'm having to use image IDs since many of the smaller images over lap and have similar visual features. The instantiated prefabs will be different depending on the position of the viewer.
    I'm pretty sure swapping the XRReferenceImage library at runtime is possible using ARFoundation 3.0 however I would like to figure out a solution in MARS. It seems like doing scene changes depending on the image ID input would be the best way to go? Thanks again.
     
  4. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    @cam415 ah, now I understand the need for changing marker libraries. For the time being the best approach would be to use different scenes.

    Also, MARS underneath uses ARFoundation for image tracking so you should be able to switch your libraries using the ARFoundation APIs.

    Being said that, its on our roadmap to support switching libraries at runtime in MARS :)
     
  5. cam415

    cam415

    Joined:
    Mar 26, 2014
    Posts:
    46
    ah ok. Thanks for the heads up. I'll go ahead and try scene swapping for now.
     
    jmunozarUTech likes this.