Level of recursion in hierarchy

Can anyone please explain me how deep a GetComponent call can go in the children hierarchy of an object?

I mean: I have a GameObject which has a child, which in turn has another child with a script attached to it. I need to call a function in that script from the first GameObject, but GetComponent seems not to be working in this case.

Thanks.

GetComponent is not recursive at all.

If you need a component down the hierarchy, use GetComponentInChildren().

I think you’ll have to get a reference to the child object first.