User Tools

Site Tools


Sidebar

hpl2:tutorials:script:player_blink

Player Blink

This simulates an eye blink every 6~10 seconds.


Create the following functions in your script file:

void Blink()
{
          FadeOut(0);
          FadeIn(0.1);
}
void BlinkTimed( string &in asTimer )
{
          Blink();
          AddTimer ( "", RandFloat(6,10), "BlinkTimed" );
}

Then, add this line to your OnStart()

           AddTimer ( "", RandFloat(6,10), "BlinkTimed" );

With this code, the screen will simulate a blink every 6~10 seconds.

Amn.-

hpl2/tutorials/script/player_blink.txt · Last modified: 2013/12/19 20:01 by amn