Yet, there's a common way to make a timer.
Assuming you have an Actor (some creature maybe), that need to be stopped for a moment and denied to perform any actions. You create new variable, say, float MyTimer
. In appropriate moment you initialize it with 2.0 value (in seconds). Then, in Tick() function write following:
- Code: Select all
void Tick (float deltaTime)
if (MyTimer > 0.0)
MyTimer -= deltaTime;
Well, ofcourse it is a simple sample, perhaps it won't fit your needs exactly.