Using a Timer while the game is paused

Hello,

I need to run a UObject’s method after a delay, with the option to cancel it, while the game is paused.

FTimer is a perfect fit for this, on paper. Except this timer needs to be running while the game is paused, and AFAICT the FTimerManager doesn’t tick while the game is paused, which prevents my timer from running as intended.

How can I achieve my goal ?

The timer manager uses the DeltaTime which get’s pased, out of the box it is not supported. So you could modify the engine (you got the source) which will be hard because the use of which type of deltas should be defined or a per-timer basis (not easy to add xD) or you could just implement your own using GetWorld()->DeltaTimeSeconds as your step.

you could just implement your own using GetWorld()->DeltaTimeSeconds as your step.
Do you mean making a new class, like UMyTimer ? I guess said class should implement FTickableGameObject ? I hoped I wouldn’t have to do that, but at least I think I know how to.
I’ll let you know if I manage to do it.

That’s exactly what I meant ^^. If you would like yo modify the engine I would create two lists of timers, each list will then use their own time step.

It turns out I don’t need this anymore, for the time being.
The game pause was triggered in our main menu UI, and we decided to simply keep the game unpaused instead, which makes my job easier :slight_smile:
If I happen to need this again, I’ll post my possible solution here.