I’m having a problem with my UI text. I have a countdown timer text and Score text . The problem I am having is the zero is not showing up along with the score text . When I click on play the score text shows like this on the scene : Score : . The Score text should be showing this way Score : 0 and their is no errors showing up in the unity console . Here is my script :
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class GameManagerSingleton : MonoBehaviour
{
public static GameManagerSingleton instance = null;
public static int score;
private Text text;
void Awake()
{
text = GetComponent <Text> ();
score = 0;
if (instance != null && instance != this)
Destroy(gameObject); // Ensures that there aren't multiple Singletons
instance = this;
}
void Update()
{
text.text = "Score : " + score;
}