Hey. I'm having trouble getting a Timer() event to function correctly inside of a state. I've previously used timers in my code without hassle but for some reason i cannot get this one to activate.
This is an example of my code:
Assuming that the state is successfully activated using GotoState('Building'); in a sub class and the log displays:Code:class MyClass extends Pawn; var int count; state Building { function beginState() { count = 0; log("DEBUG TEST 1"); SetTimer(0.5, true); log("DEBUG TEST 2"); } event timer() { log("DEBUG TEST 3"); count ++; log("count is: "@count); if (count == 5) endState(); } function endState() { } }
DEBUG TEST 1
DEBUG TEST 2
But nothing is ever logged from inside the Timer() and no warnings or errors are given. I thought there might be a boolean declared in the parent class that is preventing the use of timers (eg. bRequiresTick prevents Tick() events) but i haven't been able to find one.
If anyone can find any logic errors in this code or have ideas for a solution it would really help.



Reply With Quote


Bookmarks