# Newbie Question Timer (deltaTime)

I have a newbie question

Id like to create a timer using Time.deltaTime to count down 60 seconds and during those 60 seconds there will be bonus objects dropping to into the scene.

My problem is figuring out the timer using Time.deltaTime

if I do this:

``````var points : int = 60;

if(points > 0)
{
points -= Time.deltaTime;

}
if(points <= 0)
{
triple7Bonus = false;
points = 60;
}
if(triple7Bonus == true)
{
Spawn();
}
``````

The problem with this is the points go down so fast and Im not sure or cant figure out how to get the points to count down slow enough as if they were seconds.

All the posts that I can find are on Time.time and not on Time.deltaTime Can anyone help?

The reason I wanted to use Time.deltaTime is because I want the spawned objects to stop when the timer ends and be the same if someones using faster device or slower device if that makes any sense which Im probably wrong and should be using time.time?

Does anyone have any insight?
Also if using Time.deltaTime is possible how would I do it?

well … your points is an integer, and deltaTime is reading back to you a floating value, being calculated every frame (if im not mistaken), so therefor your 60 points are deteriorating faster than you can visually see it most likely. (i would have guessed top of my head , that it wouldnt work at all, but seems it is doing something for you , just not what you want, which is to be expected in this case).

im just throwing something out there but … not tested , just an idea to get ye going.

``````var minute : int = 60;
var second : float = 0;

second += Time.deltaTime;

if(second >= 1.0f){
second = 0;
minute--;
}
``````

Thank You willc

That did the trick and its greatly appreciated! Im gonna have to store that one in the memory bank for other uses as well