Morning folks!
I'd like to have a time limit on my game, and i tried to get a timer counting down in my class that extends UTHUD like so:
And then the separate function..Code:function DrawGameHud() { local string timerText; SetTimer(60, false, 'GameOverTimer'); //after a minute it'll be game over atm Canvas.SetPos(Canvas.ClipX/2,Canvas.ClipY/6); Canvas.SetDrawColor(255,60,210,255); Canvas.Font = class'Engine'.static.GetSmallFont(); //total time - current time = time remaining timerText = "Remaining time: "$(string((GetTimerRate('GameOverTimer') - GetTimerCount('GameOverTimer')))); Canvas.DrawText(timerText);
While the text displays on screen as expected it does not countdown, it just stays at 60, also i've waited 60 seconds in the game and the "Game Over" text is not drawn.Code:function GameOverTimer() { Canvas.SetPos(Canvas.ClipX/2,Canvas.ClipY/2); Canvas.SetDrawColor(55,200,210,255); Canvas.Font = class'Engine'.static.GetLargeFont(); Canvas.DrawText("Game Over"); }
I thought maybe the HUD wasn't the best place for a game over timer anyway and that perhaps it should be in the game type? but then i'm not sure how i would get the value from there and display it in the HUD..
I should probably mention that i've JUST started learning so my mistakes could be monumentally obvious, really appreciate any help you could give me.



Reply With Quote
If so, I'm sure one of the pros will correct me 



Bookmarks