How do you access non-static variables from scripts in unity 5?

I’ve been looking around for ages trying to find a way to do this, but every single time I try it, I always get the inspector showing me several errors that shouldn’t be there because everything is defined in the way I’ve seen them be. So, I’ve come here in hopes that someone can help me. All I want is my targetCount variable to be shared from my Bullet script to my Progression one.

Please note that both of these scripts are on my “Player” Game object.

Also, please note that I’m using version 5 of Unity and that the errors that I am currently getting from the inspector are all referring to my Progression script and they are:

the name “thePlayer” does not exist in the current context.
the name “targetCount” does not exist in the current context.

Here is everything you need to know from my Bullet script:

using UnityEngine;
using System.Collections;

public class Bullet : MonoBehaviour 
	public int targetCount = 0;

	void OnCollisionEnter (Collision collision) 
		if (collision.gameObject.tag == "Enemy") 
			Destroy (gameObject);
			collision.gameObject.tag = "Untagged";
			Instantiate(fireEffect, collision.transform.position, Quaternion.identity);
			targetCount = targetCount + 1;

Here is everything you need to know from my Progression script:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Progression : MonoBehaviour
	void Start ()

GameObject theplayer = GameObject.Find ("Player");
		Bullet bullet = thePlayer.GetComponent<PlayerScript> ();
		bullet.targetCount = targetCount;

Oh, and don’t worry about the parsing errors :stuck_out_tongue:

There are a few things I can say.

First: I hope the missing {} at start is an typo.
Second: Try adding an tag to the player and call it by the tag
Third: Is the player created later then the Progression script?

and lastly the thing I almost missed…

Start() {
    gameobject theplayer = <define player here>;
}

would limit variable theplayer inside the Start() function, to bypass this simply:

private gameobject theplayer;

Start() {
    theplayer = <define player here>;
}