I am new to Unity and C# and recently I got stuck on an error which I constantly receive without knowing the exaxt cause.
I am trying to connect a text script to my player script but it keeps saying that it can’t acces the variable ‘playerScore’ even though I am connecting the player script to my text script.
Webpage
here’s the code of the text script:
public GameObject player;
public Text scoreText;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
scoreText.text = player.playerScore.ToString();
}
}