Text not updating on screen?

Not sure if this is the right place to post this, but when I update my Text component, the value in the editor changes but the value on screen remains the same. The only way to force it to update so far is to manually change any value in the Text component (Font Style, is Rich Text etc…)

Out of desperation I tried to change one of these values in code after executing my value change code… Didn’t work. Has to be manually changed.

Apparently this is a bug that “Has been fixed” in later versions, but right now porting my entire project over to a later version of Unity just to update my text on screen seems ridiculous.

I’m using Unity 2018.3.1f1.

Things to note:

I’m using two scripts, one stores all the UI elements on my screen in variables.
The other script that executes the code locates the Text component through that script.

For example:

Script One:

//Script Class
public class scriptUserInterface : MonoBehaviour

//Variables
public Text gold;
public Text health;

Script Two:

//Script Class
public class executionScript : MonoBehaviour

//Variables
public scriptUserInterface userInterface;
public int value = 500;

//Function
void OnFunction()
{
    userInterface.gold.text = (value).ToString();
}

*The above code is not expected to work, it’s just an example of what I’m doing.

Any help on why my Text component is not automatically updating during runtime would be greatly appreciated…

Seem to have figured out a fix for this… Seems really unnecessary but at least it works.

At the end of my function, after executing all the changes to the Text component, I just added

userInterface.gold.SetAllDirty();

Example:

public void SetGold()
{
    int amount = 1000;
    yourTextComponent.text = amount.ToString();
    yourTextComponent.SetAllDirty();
}