wait (var time)

Pauses the current function, and resumes it after a frame cycle or after a time given in seconds. Runs other functions during the wait time.

Parameters:

time - either 1 to wait one frame, or a negative number between -0.01 .. -60 to wait the given number of seconds.

Speed:

Medium

Remarks:

Examples:

// let an entity light up for half a second, and then rotate it permanently
action rotator() 
{
  my.ambient = 100;	// increase brightness
  wait(-0.5);			// wait 0.5 seconds
  my.ambient = 0;		// normal brightness
  while (1) {
    my.pan += 3*time_step; // rotate entity by 3 degrees per tick
    wait(1); 		// wait one frame, then repeat
  }
}

See also:

return, time_step, timer, num_actions, proc_status, wait_for, engine_gettaskinfo

► latest version online