I have used the GameObject.Find() command and know how to use the find with the “/” letter for hierarchies. My question is: is there some way to just search the children of an object for a object by name?
I ask this because I have children named “ShadowBlob” of many main objects. I don’t want to find all the “ShadowBlob” objects, I just want to find the one attached to a particular main object in the main object’s script. Is there some way to do this?
That does help, thank you. Now, how do you convert from a Transform to a GameObject? I was able to retrieve the Transform before but that didn’t give me the info I needed from the actual GameObject.
GameObject.Find() searches all objects for a match but there’s actually an analogous Find() function you can call on any transform object to only search the children.
Looping over the children (unless you do a recursive loop) will only search one depth down. transform.Find() will search in all children.