Question by
Tramplex · Dec 24, 2016 at 10:56 AM ·
gameobjectinstantiatearray
How can i Instantiate gameobject in array
I want to add to array an instance of gameobject in my resources folder. I do it like this:
Invg [i] = Resources.Load (grabbed.name) as GameObject;
but then , when i change some in Inv[i] gameobject that henges applied to prefab in resources folder. I Do not want it this way. When i use Instantiate() :
Invg [i] = Instantiate (Resources.Load (grabbed.name) as GameObject);
but this code instantiates gameobject not only in array but on the scene too in random position. What shold i change in code?
Comment