How to find the spawned Player gameobject?

On the client side, how do I find the spawned gameobject that belongs to the proper client?

My understanding was that all Players’ gameobjects could be retrieved through ClientScene.localPlayers, which contains a list of PlayerControllers. Each PlayerController has a playerControllerId, which is a short.

The question is then, I suppose, how do I find my playerControllerId on the client?

Sorry if I’m wrong but first you set the client to be Ready ClientScene.Ready(conn) , then you pass the controller id on the ClientScene.AddPlayer(id), so you can find the player by its id on the list ClientScene.localPlayers[id].

I’m not sure you answered my question.
And what’s more, OnClientConnect is the one that calls ClientScene.AddPlayer and the parameter that it passes is always 0.

So basically I don’t understand the logic of it all, and my question of how to find the correct Player gameobject for the local client is still unanswered.

Another thing that I tried was to run this code on a class of the gameobject that servers as the PlayerPrefab, but it didn’t work either:

  public override void OnStartClient()
  {
    base.OnStartClient();

    if (isLocalPlayer)
    {
      // I assumed "this" would be the gameobject that I'm looking for, but isLocalPlayer does   something else apparently
    }
  }

By running the same code in a simple Start(), it worked.
No idea why OnStartClient() didn’t yield the same results.

Maybe OnStartClient is executed before you can have a localplayer.