Is it possible to use GameObject.Find in conjunction with an object that is defined in a variable? I want to create something that would look kinda like this (I know it’s syntax is way off, but I hope it get’s the idea across):
var MyPrefab: GameObject;
var Spawned: GameObject[];
var Point: Transform;
var Count: int;
function Start(){
Spawn();
}
function Spawn(){
if(Count <= 5){
Count += 1;
Spawned[Count] = Instantiate(MyPrefab, Point.position, transform.rotation);
Point = Spawned[Count].GameObject.Find("/MyChild01").transform;
Spawn();
}
}
Thanks.