- Home /
Question by
burgunfaust · Apr 29, 2011 at 02:24 AM ·
gameobjectinstantiateaddcomponent
Instantiating an entire object at runtime
I have been having problems with instantiating multiple versions of a prefab at runtime, so I would like to try something else. I would like to create the entire object from individual assets at runtime, but I'm not really sure how to go about it.
Here is where I'm at:
In my start function, I am reading an external text file, parsing it, and creating a data array. I had been using that data array to instantiate a prefab, adding data to it, adding scripts to it, and then moving on to the next one.
I use a for loop to run each segment of the array, so I would like to continue to use that. I want to create an empty object, then add a mesh, a texture, and a collider.
Javascript is all i get, no C#. Thanks.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613130128im_/https://answers.unity.com/themes/thub/images/avi.jpg)