Search Unity

Prefab as child of empty gameobject.

Discussion in 'Scripting' started by sygaki786, Mar 5, 2015.

  1. sygaki786

    sygaki786

    Joined:
    Jan 26, 2014
    Posts:
    142
    I had the issue where my prefab was built with a certain rotation, but on instantiating it the rotation was lost. So I made the prefab a child of an empty gameobject. That fixed the issue, but now I have the issue that I cannot apply a color to the material dynamically since what I instantiated is an empty gameobject, which has no renderer. How do I get a handle to the prefab child of the empty gameobject?

    Thanks,
    Syed
     
  2. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    994
  3. sygaki786

    sygaki786

    Joined:
    Jan 26, 2014
    Posts:
    142
    Thanks. Find worked.