How can I find and access Local player components using PUN2 in Unity?

Options

Hello,

I have 2 scripts 1: Player and 2: Game Manager, both spawn when the game starts.

Since each player will be spawning the same 2 objects (player and game manager) when the game starts... How can I get the local Player script on Game Manager Start function?

I tried this method:

But it sometimes works and sometimes returns Null Reference error and breaks my game.

Answers