Hi all i have problem as it displays me this Cannot convert 'String' to 'float'.
Im trying to make a timer, when i add 30 seconds it will add 30 to float, but have it in format so its minutes and seconds, if i dont format then instead showing 1 : 20 [1 minute 20 seconds] it shows 80.
Heres my code
public var startTime : float;
public var minutes : int;
public var seconds : int;
public var textField : UI.Text;
public var timerIsActive : boolean = false;
function Start()
{
textField = GetComponent(UI.Text);
}
function Update ()
{
textField.text = startTime.ToString();
startTime = String.Format ("{0:00}:{1:00}", minutes, seconds);
}
I been trying to figure out and was googling ideas and all for hour or even more but just gave up can't find anything.
Would really appreciate if someone could help.
Thanks !
↧