- Home /
Get(specific)Child().
Hi, I have many identical game objects, each with a handful of children objects. In a script on the parent, i want to get a specific child of the object. I don't really want to do the foreach method if i don't have to. I would like to be able to say GetChild.find or something like that. Is that possible?
thanks!
returns: error CS0029: Cannot implicitly convert type UnityEngine.Transform' to
UnityEngine.GameObject'
Answer by ForeignGod · Mar 18, 2015 at 01:23 AM
var yourobject : Transform;
function Update() {
yourobject = transform.Find("Whattever");
}
Your answer
Follow this Question
Related Questions
Switch for children not working 1 Answer
What is the best way to grab and move the immediate children of a GameObject. 1 Answer
Unity detects three children of the current object, but only grabs one 1 Answer
Foreach loop trying to grab all children in scene 1 Answer
Question on Using a Foreach Loop on Nested Children 1 Answer