- Home /
Question by
ina · Dec 27, 2010 at 10:06 PM ·
gameobjectinstantiatefindnameclones
All subsequent instantiated objects = auto-named with suffix (Clone)?
Just double checking, will all instantiated objects of "Bill" be called "Bill(Clone)" ? (At least that is what they are reading as in hit.transform.gameObject.name
)
In that case, to find these objects, would you use Find("Bill(Clone)")
instead of Find("Bill")
Comment
Best Answer
Answer by Tetrad · Dec 27, 2010 at 10:33 PM
That's the default name but you can change that.
GameObject go = Instantiate( prefab ) as GameObject;
go.name = whatever;
since by default all clones will be named "Clone(clone)", basically with the (clone) suffix, will you have to use Find("Clone(Clone)" ins$$anonymous$$d of just Find ("Clone")?
Yes, unless you rename them on instantiation like demoed above, add (Clone) to your prefab name when searching for it.