GetComponents vs GetComponentsInChildren

Hello guys !

I just encountered a little problem with these two functions, so I went to the online doc and I saw a really important difference : GetComponents seems to work on inactive game objects, contrary to GetComponentsInChildren …

Is there an easy way to get the components in children of an inactive game object ?

Depending on the Unity version you’re using you can simply pass an additional parameter which will include inactive objects as well:

GetComponentsInChildren<Renderer>(true)

the docs