Why is Find() not working?

I have used the line GameObject player = GameObject.Find(“Player”); but it keeps returning null, I have also tried a couple other ways of doing this but none work I just keep getting null.,I have used the code GameObject player = GameObject.Find(“Player”); although it keeps returning null, I have also tried a few different ways of doing this.

Thanks for the help!

Most likely, if it is returning null, then no object exists with the name “Player”.

On a script of your player object, put this in Start to make sure that the player name is what you think it is.

Debug.log(gameObject.name):

Sometimes if you do something such as spawn the player in, then the name will change to something like “Player (clone)”.

Check “Player” GameObject is active at the moment “Find” is performed.