find model

I have a main gameObject called CSB it’s just an empty container with a script.

Inside the script I instantiate a model and name it “mymodel”
It then appears on screen with the name in the inspector thing.

How do I use GameObject.Find() to find the model from the main script let’s say I want to check its name or add a component or something.

Once it finds it. Is it a gameObject? or some other type of object?

Thanks,

Dan

Well, when you create it, do something like this:

var temp : Transform = Instantiate(object, objectPosition, objectRotation);

Then temp is a reference to the object you created and you can play with it as necessary. If you wanted to find it after that, you’re probably best off assigning it to a variable in the script.

If it’s found with GameObject.Find, it’d be GameObject type.