Set Timer Function not working?

im following a tutorial from Unreal Engine AI Tutorial #4 - EQS Sentry Gun Part Two - YouTube
by zoombapup… he’s using 4.6

there’s a sentry fun, with fire rate, sentry turn rate…
and a function FireGun

the function FireGun never gets called when the SetTimer Node runs…

i got the function to work by using delay

but, why wont it work with the timer?

1 Like

Did you set your firing Rate to non zero? A value of zero will cause it not to begin at all.

Also setting a Timer in tick can be pretty silly, if you read the tooltip, setting a timer again will cause the current instance of the timer to become reset. So if your setting the timer every frame it will never actually do anything cause it does have time to invoke any function before it gets reset again.

2 Likes

As i remember timer event is not working when time is <=0 or timer was cleared/paused. Use breakpoints to detect it. Also maybe time is too high? in this example firing rate 10 is not 10shots per second but 1 shot every 10 seconds.
added:
lol…im a bit late xD

i tried to debug with using the Get Timer remaining time by handle and Get Timer Elapsed… its shows that, elapsed time seems to be stuck at 0… and remaining time never seems to go down… hmm, why is it not counting down…

i triedd to add a 10 second delay node just before the timer is called… guess what, it worked now… the delay gave just enough time to let the time run it’s timer and the function firegun to be called… it seems without the delay node, the timer keeps on resetting whenever its called…

so yeah, its with the event tick i was following in the tutorial, i guess its a bit outdated… :o

Timers also are disabled if your game is paused

1 Like