Text UI not updating

Hi! I’m new to Unity and C# and working on a project. I want to make an on-screen timer tick down as the player moves, but for some reason the text on screen isn’t updating. Here’s the script I’ve put on the text object, which I have as the child of a UI canvas:

using UnityEngine;
using UnityEngine.UI;

public class MovementUI : MonoBehaviour
{
    //Script changes UI text to display value of MovementTimer.movementTimer

    float movementMeter;
    Text display;

    // Start is called before the first frame update
    void Start()
    {
        display = GetComponent<Text>();
        movementMeter = GameObject.Find("PlayerCircle").GetComponent<MovementTimer>().movementTimer;
        Debug.Log(movementMeter);
    }

    // Update is called once per frame
    void Update()
    {
        display.text = "" + movementMeter;
    }
}

You can see that the float movementMeter is initialized to a float from another script. This is working correctly, Debug.Log(movementMeter) in the Start function prints the correct number to the console. I’m guessing it’s a problem with how I’m using display.text, but I’m not sure.

Thank you!

movementMeter will get set once in the start, I am not seeing where you are having it tick down? Is the number you are seeing displayed different from what is logged in start? From what I am seeing your are not altering movementMeter so it will be the same every frame, and thus the text will not change. Initializing it to the float from the other script doesnt mean every time it changes in the other script you will see it in your update change. You have a local float variable, you are setting its value once and only once.

Make sure you have an event system in your hierarchy, I know you need it for buttons but maybe it’s for all ui updates