Score Text Skips Update At Random Times (Android)

I have 2 scripts. One updates a variable, “Score” every time a person swipes an object:

void scoreupdate()
	{
		if (updatescore == true)
		{
			HUDscript.Score = HUDscript.Score + 1;
			updatescore = false;

		}
	}

In the same script I have a FixedUpdate method that calls the scoreupdate function on this block of code (I did not post the whole thing since it is too long):

						if (t.phase == TouchPhase.Ended) {
								
								//resets initial touch position
								initialtouch = new Touch ();
								scoreupdate();
								
						}

In the second script, I’m using the new Unity UI to show the score. The Script is really simple. It is as follows:
using UnityEngine;
using UnityEngine.UI; //uses Unity’s UI System
using System.Collections;

public class HUDscript : MonoBehaviour {
	public Text Text;
	public static int Score = 0;
	void Start()
	{
		Text = GetComponent<Text> ();
	}


	//updates score
	void Update()
	{

		Text.text = "Score: " + Score;
	}

}

- The bug is this: When I play the game on my Android device, It DOES update the score EVERYTIME,
BUT it does not show that updated score on the UI.
The reason I know it updates is because the Next time the user swipes the object it shows the correct Score.
Can someone please tell me why it randomly skips showing the score like this, and how I can fix it?

Thanks In advance! :slight_smile:

I imagine it’s because you’re using FixedUpdate() to detect your touch input which may get called zero, one, or more times in each frame of the game depending on your physics time step. FixedUpdate should only be used for physics calculations. Do input in Update().