I need to programatically make a object a child of another object, and I have searched documentation, but I can’t find anything. Any ideas?
transform.parent
–Eric
Thanks! Will this change the scripting so that something like GetComponentInChildren() will work?
I’m not quite sure what you mean…look up transform.parent in the docs.
–Eric
heh,
Checked up the unity docs, it will do a physical parenting, but I don’t believe it will make it so you can use something like GetComponentsInChildren()
Why not? There’s only one kind of parenting. Either an object is the parent of a child or it’s not.
–Eric
Should work fine, but you have to do the parenting then search for the components. Use a yield statement if necess and Debug along the way.
AaronC