- Home /
Question by
patrico91 · Sep 22, 2012 at 10:21 PM ·
gameobjectinstantiate
Instantiate gameobject
How to Instantiate object to game from this list using javascript?
asd.png
(195.0 kB)
Comment
Next time search a little in documentation ;) http://docs.unity3d.com/Documentation/ScriptReference/Object.Instantiate.html
Answer by Muuskii · Sep 22, 2012 at 10:47 PM
One way that you can do this is to have a list of GameObject/Transform references at the top of your script and then call Object.Instantiate on whichever one you need at the moment.
I assume there are some prefabs in that folder, correct?
Answer by patrico91 · Sep 23, 2012 at 01:34 AM
I want to do something looks like to this code
GameObject.Instantiate(GameObject.Find("Main"), hit.point,transform.rotation);
I do not want to use object from Hierarchy list but from Project list.