Tutorial: Script - Timer/Indicating

  • Programming a timer or blinker is not that simple, since commands like "delay" or "sleep" are impossible to use.

    1 HUGE THANKS TO thor2950 FOR THE TRANSLATION!

    2 Principle

    Since the SimStep-procedure is executed on every frame, it needs to be executed as fast as possible and commands like "delay" or "sleep" are prohibited. This also applies to infinite loops, such as while(true).


    To program a timer, you need to "mark" the time point at which the timer was initiated and then check if the time has run out. If this is the case, the timer is the deactivated or reset.

    3 Implementation

    This could look something like this in a script: