Search Unity

How to instantiate in Hierachy

Discussion in 'Scripting' started by grimmy, Aug 21, 2009.

  1. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    So how do I instantiate an object at a set position the the Hierarchy? Currently when I instantiate an object using..

    Code (csharp):
    1.  
    2. directoryButton[x]=Instantiate (firstButtonObject);
    3.  
    ..it appears in the root. (even if the original obeject was a child object of another in the Hierarchy pane. I want the object to be a child of another object once created.

    Any ideas? I coulnt find anything in the docs.
    Cheers
     
  2. Slem

    Slem

    Joined:
    Jan 28, 2009
    Posts:
    191