From the video ((SCORE & UI - How to make a Video Game in Unity (E07) )) how to fix ?

In  "

SCORE & UI - How to make a Video Game in Unity (E07)
" I wrote like this in the text script ----->

using UnityEngine;
using UnityEngine.UI;

public class Score : MonoBehaviour {

public Transform player;
public Text scoreText;

// Update is called once per frame
void Update () {
scoreText.text = player.position.z.ToString();
}
}

and it does not work, help.

Did it print any error in UnityEditor console? I need enough information.

I think you might forget connect “scoreText” (in script) with “Text” Component (in UnityEditor Inspector).

plz check 7:40 in the video