Why does my timer not .. time?

In Tick I have the following code:

if (GetWorldTimerManager().IsTimerActive(SpellTiming_BurstIntervalCount))
	float TempaFloat = GetWorldTimerManager().GetTimerRate(SpellTiming_BurstIntervalCount);
	GEngine->AddOnScreenDebugMessage(-1, 50.0f, FColor::Red, "Timer: " + FString::SanitizeFloat(TempaFloat));
} else
	GetWorldTimerManager().SetTimer(SpellTiming_BurstIntervalCount, 25.0f, false);

AddOnScreenDebugMessage displays 25 and never changes.

Why does it not increment/ what am I doing wrong?


did you mean:

Ah! That works. Thanks.

I saw the “float InRate” bit of the SetTimer function and assumed Rate was what I was looking for.

My GetTimerElapsed is not working either, how did you manage to fix the issue? mine is stuck at 0.19 for some reason, and half the time its -1.

How are you using it?

GetWorldTimerManager().SetTimer(Handle, Time, false);
float Elapsed = GetWorldTimerManager().GetTimerElapsed(Handle);

The above works fine for me.
I also tend to use TimerExists in checks if Im not sure the timer still exists.

And IsTimerActive for if it is still running.

Being stuck on a number sounds like it could be paused or being constantly set to that time somewhere.