Having trouble getting score value from other script.

So I have a script attached to the main camera called “HUDScript”, inside that script it increments my score based on how much time has passed. I have another script attached to my player called “Platformer2DUserControl”, and i want to get the score from the other script because im going to use that to slowly increment my speed based on that value.

HUDScript

using UnityEngine;
using System.Collections;

public class HUDScript : MonoBehaviour {

    float playerScore = 0f;
 
    // Update is called once per frame
    void Update () {
        playerScore += Time.deltaTime;
    }

    public void IncreaseScore(int amount)
    {
        playerScore += amount;
    }

    void OnDisable()
    {
        PlayerPrefs.SetInt("Score",(int)(playerScore * 100));
    }

    void OnGUI()
    {
        GUI.Label (new Rect (10, 10, 100, 30), "Score: " + (int)(playerScore * 100));//pixle loacation, pixle location, pixle wide, pixle tall
    }
}

Platformer2DUserControl

using UnityEngine;
using UnitySampleAssets.CrossPlatformInput;

namespace UnitySampleAssets._2D
{

    [RequireComponent(typeof (PlatformerCharacter2D))]
    public class Platformer2DUserControl : MonoBehaviour
    {
        private PlatformerCharacter2D character;
        public float score;
     

        private bool jump;

        private void Awake()
        {
            character = GetComponent<PlatformerCharacter2D>();
        }

        private void Update()
        {
            if(!jump)
            // Read the jump input in Update so button presses aren't missed.
            jump = CrossPlatformInputManager.GetButtonDown("Jump");
            score = HUDScript.playerScore;
        }

        private void FixedUpdate()
        {
            // Read the inputs.
            //bool crouch = Input.GetKey(KeyCode.LeftControl);
            //float h = CrossPlatformInputManager.GetAxis("Horizontal");
     
         
            // Pass all parameters to the character control script.
            character.Move(1f + score/100, false, jump);//character.Move(h, crouch, jump);
            jump = false;
        }
    }
}

I tried many ways but every single one gives me an error in a compiler, if you can help i would be greatly appreciated.

What does the error says? It might be HUDScript from Platformer2DUserControl no?
Also playerScore private, unreachable?

Its generally along the lines of this (this is my current builds error…)

Assets/__MyScripts/Scripts/Platformer2DUserControl.cs(26,43): error CS0122: `HUDScript.playerScore’ is inaccessible due to its protection level

I see, make playerScore public or make accessors for him.
Then in Platformer2DUserControl you need a object of type HudScript to access playerScore.
Try something like this:

GameObject objHud;
HudScript hudScript;

In Start:
if(GameObject.FindObjectOfType())
{
objHud = GameObject.Find(“nameOfHudScriptObjectInScene”);
hudScript = objHud.GetComponent();
}

In Update:
score = hudScript.playerScore;

another way:

//This will be exposed in the expector, drag/drop the object that have HudScript in it
public HudScript hudScript;

In Update:
score = hudScript.playerScore;

This will help you:http://docs.unity3d.com/412/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html