I’ve created a game in the latest unity3d engine on a windows vista pc. I tried the game on a vista and xp machine, and it works like it should but when I try it on a windows 7 machine, the game doesn’t work like it should, more specifically the timer in my game. It goes way to fast, is this a common issue or is there something I forgot to implement?
I’ve included my timer script, I guess that’s were the problem should be?
static var gameOver: int = 0;
var startTime: int= 3000000;
var strStartTime;
static var extraTime:int = 0;
function Start(){
}
function Update () {
if (Game.gameOver==0){
extraTime = timeCollision.extraTime;
//Debug.Log("Extra time:" + extraTime);
if (startTime > 1){
startTime--;
}
else
{
Game.gameOver=1;
}
startTime = startTime + extraTime;
//Debug.Log(startTime);
formattedTime=startTime+"";
//Debug.Log(formattedTime);
var minutes : int = startTime / 60;
guiText.text=formattedTime;
guiText.text = String.Format ("{0:00}", minutes);
//timeCollision.extraTime = 0;
if (startTime == 0) {
guiText.text="Time's up";
Game.gameOver=1;
}
timeCollision.extraTime = 0;
}
}
function FormatTime (time) {
var intTime : int = time;
var minutes : int = intTime / 60;
var seconds : int = intTime % 60;
timeText = seconds.ToString ();
return timeText;
}