Good practice of accessing members of other scripts

Am i thinking correctly?

I have a GameObject called “PlayerOne”.
On it i have a script called “PlayerController” which stores information about playerOnes score, health and lots of other stuff.

I want to be able to access PlayerOnes score from SomeOtherScript. Good Unity practice is to

  1. first get the GameObject

    GameObject playerOne = Find(“PlayerOne”);

  2. then get the script as a component

PlayerCController playerOneInfo = playerOne.GetComponent<PlayerController>;
  1. Get the score from the script

    var score = playerOneInfo.Score;

Is this as straight forward as Unity intends it?

Yes, that is a pretty standard way, although since Find() is performance heavy you should assign it to a variable for later use, like you are doing in your script. Another popular solution is to make a public variable in SomeOtherScript and assign PlayerOne to that variable in the Inspector, like so:

public GameObject playerOne;

void Function() {
    // Access score through component in playerOne
    PlayerCController playerOneInfo = playerOne.GetComponent;
    var score = playerOneInfo.Score;
}