User Tools

Site Tools


Sidebar

hpl2:tutorials:script:player_blink

This simulates an eye blink every 6~10 seconds.


Create the following functions in your script file:

void Blink()
{
          FadeOut(0);
          FadeOut(0.1);
}
void BlinkTimed()
{
          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.1373321998.txt.gz · Last modified: 2013/07/08 22:19 by amn