this is super annoying and I cant seem to understand why im getting it, someone explain it please?
Heres the line that gives me the error;
txtDate.text = DateNumber.ToString("0");
and heres the whole script;
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class CalanderScript : MonoBehaviour {
public Text txtDate;
private float DateNumber;
public int CapValue;
public int TimeValue;
void Start () {
txtDate = GetComponent();
DateNumber = 1;
}
// Update is called once per frame
void Update()
{
DateNumber += Time.deltaTime / TimeValue;
txtDate.text = DateNumber.ToString("0");
if (DateNumber >= CapValue)
{
DateNumber = 1;
}
}
}
↧