So i have a script returning a value but the new UI script hates me as all new things usually do so it wont return the ToString value from FreezeTimer.
Script looks like this:
#pragma strict
import UnityEngine.UI;
public var Text : Text;
static var FreezeTimer : int = 5;
function Start ()
{
MyCoroutine();
}
function MyCoroutine()
{
while(FreezeTimer > 0)
{
FreezeTimer --;
yield WaitForSeconds(1);
}
}
function update ()
{
Text.text = FreezeTimer.ToString("0");
}
you don’t need to create a new thread for an update to a question…
and if you followed the @Sushin 's suggestion it would work.
the optional parameter for the ToString() function needs to be a valid formatter string, “0” isn’t one of them. For your usage you could just leave it out (as suggested).