Hello:
I’m trying make a marker for the score of my game, but my UI Text don’t update the number.
This is my Code:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Score : MonoBehaviour {
Text scoreRecord;
// Use this for initialization
void Start () {
scoreRecord = GetComponent<Text>();
}
// Update is called once per frame
void Update () {
scoreRecord.text = "3";
}
}
Always the ui text print a zero by default.