Why aren't I accessing this variable?

I’ve been searching the forums and trying different things but I just can’t seem to get this to work.
I just want to access a public variable from another script. I have a GameManager object with a GameManager script attached to it. I also have a Player object with a PlayerController script.

//GameObject Script
public int life =100;
//PlayerController Script

//references
public GameManager gameManager; //The GameManager game object is connected in the inspector.

    void Start()
    {
        print(gameManager.GetComponent<GameManager>().life);
    }

But the print returns a 0 when it should be 100.

switch this part

 void Awake()
    {
        public int life = 100;
    }

I wondered about that but it still doesn’t work. Even if I declare the variable with value of 100 at the top of the script it returns 0.

Oh wow. Fixed it… I had deactivated the game object in the scene while testing something before.