GetChild????

transform.GetChild() is not listed in the scripting manual! WHY?

I’ve been looking for a way to access an object’s children for quite some time now.
(My prefab instances are a GameObject with several child GameObjects with Meshes I need to be able to hide/unhide)

Then I remembered the FPS tutorial dealed with this problem when selecting weapons. So I opened the weapons script and found the GetChild function, which is great, its what i need, but then I went to the scripting manual and GetChild isn’t there!!

Why isn’t it there? I think it should be there, this makes me feel very uneasy… and kind of dizzy, I’m a fragile human being :frowning:

further research made me notice there’s this command transform.Find() which by its description it’d be the same as transform.GetChild()

I was previously thrown off by GameObject.Find() which it search in all the scene, not just the children

C# code
GetComponentsInChildren also gets the parent object so index [0] might be null if there is no mesh

MeshFilter[] meshFilters = GetComponentsInChildren<MeshFilter>();

// in a loop
meshFilters[i].renderer.enabled = false;

You could just get if you want. I just had that code handy.