- Home /
How to instantiate object onto other object from script
I need to make an instance onto one object, but the script is not attached to this one. So I used this code
var Prefab : Transform; var Clone : Transform;
Object = transform.Find("Instantiator"); Clone = Instantiate (Prefab, Object.position, Object.rotation);
If I use "gameObject.Find" I can't instantiate the object in the position because ("GameObject.position is not a member of UnityEngine.transform.position")
Answer by Mike 3 · Aug 25, 2010 at 06:42 PM
Try GameObject.Find instead, transform.Find will find a direct child to the current transform
Your answer
Follow this Question
Related Questions
Instantiate a COMPLETELY Unique Instance of an Object 1 Answer
How do I restrict game to only instantiate 1 instance of object? 1 Answer
NullReference Exception when adding a class 2 Answers
Everytime I Instantiate, object becomes smaller. 2 Answers
Moving and manipulating object trought scenes in Unity 4 0 Answers