How do i slow down my counter? (JavaScript)

Hi Guys,

I have written out a timer script for my gui but it goes to fast and i don’t know how to slow it down.

Thank You,

var Counter : int = 0;

function Update() {

Counter++;
guiText.text = ""+Counter;


}

Your problem is that you are updating the timer on every frame. Try using a timer to make a method that updates the counter fire every X milliseconds/seconds etc. Also if you test your game in a powerfull rig, you most likely have more than 30 fps so it will be very fast.