- Home /
 
 
               Question by 
               pion · Jul 29, 2011 at 03:38 PM · 
                getcomponentinchildren  
              
 
              Get sphere at run time
I have created a sphere and name it "Origin" in the Editor.
How do I retrieve this object at run time using C#?
Thanks in advance for your help.
               Comment
              
 
               
              Answer by pion · Jul 29, 2011 at 03:43 PM
I found this answer: http://unity3d.com/support/documentation/ScriptReference/GameObject.Find.html
GameObject origin = GameObject.Find("Origin");
Your answer
 
             Follow this Question
Related Questions
WHy cant I create the GetComponentsInChildren(Renderer) array? 2 Answers
How to get script from Object with (Clone)'s script? 2 Answers
Access the renderer of a clones child object 1 Answer
How to call GetComponent by name? GetComponents? 2 Answers
Excluding certain children from a loop (changing parented children's colors on mouseover) 2 Answers