wait (var time);

Pauses the current function for a number of frame cycles or seconds. Resumes other functions inbetween.

Parameters:

time - number of frames when positive, time in seconds when negative (-60 .. +1000).

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 ► latest version online