increment in a value with time.deltatime/time.fixeddeltatime

i’m creating a game in which enemy spawn from random position .(this game is for android mobile,android tablet)
1}i’m using a timer, at every even second a enemy is spawn.Like :- if i set the timer 60 sec then enemy spawn (2,4,6,…,58)sec.
but its like player have to wait for enemy to spawn.
so my question is:

var timer:float;
    function Update()
    {
     timer += Time.deltatime;
     if(timer > 1)
     {
      //spawn enemy
       timer = 0;
     }
    }

//but i’m not sure that it gives the same result on different mobile/table. i think calculation in Time.deltatime is depend upon run-time platform or if i used Time.fixeddeltatime.

the calculation is platform independant.

FixedDeltaTime is just the physics timestep.

delta time is the time between frames.

delta time allows you do this with varying frame rates thats all.

your doing it correct with timer = timer + time.deltatime

that will give you in seconds the passage of time.

mark as answered :slight_smile: