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 How to get access to AR tracked prefab's child?

Discussion in 'AR' started by iodeanman, Dec 20, 2021.

  1. iodeanman

    iodeanman

    Joined:
    Oct 22, 2014
    Posts:
    1
    I'm just starting my project on image tracking, basically I just want a button to change the material of all child of the spawned prefab and another button to hide some of them.

    I'm pretty new to Unity...I kinda know how to change material and hide stuff when the gameObject was there but don't kwon how to do it when it spawned from Image tracking??
    not sure what line of code will get me to access those object??
    Can anyone help me please?
     
  2. Infinite_Showrooms

    Infinite_Showrooms

    Joined:
    Oct 23, 2017
    Posts:
    8
    I'd honestly recommend buying this. @KirillKuzyk has one more day in the sale and this'll make it much easier for you to troubleshoot what's going on in the scene and your code as you try to access those child objects from a button: https://assetstore.unity.com/packages/tools/utilities/ar-foundation-remote-2-0-201106

    My tripod allows me to just run a session but then leave the phone in position while streaming to the computer where I can see everything happening in the Unity Editor.
    If that asset works for you, then you could also buy a tripod for like $25 on Amazon.

    Sorry I can't help you with this problem, specifically, but this should be the testing tools you need to figure it out (and every other problem you run into) MUCH quicker.
     
  3. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324