Find GameObject in grandchildrens [SOLVED]

3193980--243967--upload_2017-8-23_15-10-54.png

Hello !
This is my hierarchy. The GameManager is instanciated by the Camera. I have a script in my GameManager that is supposed to set a default selected GameObject to my EventSystem (it is supposed to be moveButton). I put it in Start(). The problem is that i tried a lot of things that i found on this forum but it never seems to work. I always get the error : Object reference not set to an instance of an object. moveButton being multiple levels down the hierarchy, i have trouble referencing it.

So what i would like to know is how would you approach this problem. What would you put as a parameter to :

eventSystem.SetSelectedGameObject(?);

Thanks !

I’d probably just create a reference to it and drag and drop in the inspector. But what is your use case? Are you always setting the moveButton as default?

Why didn’t i think about that haha.
It’s working now but turns out after all that the error was not coming from trying to find moveButton but rather my EventSystem reference didn’t reference anything because of a typo. Moving on now.

Thanks for the help !