I have a custom UObject and wanted a tick function. So I derived it from FTickableGameObject. At first sight, this seems all well and good. But then I noticed it keeps ticking when the game is paused despite IsTickableWhenPaused() returning false.
So I worked around it by having IsTickable() return false when the game is paused by the user.
But here’s the problem. It seems the game also pauses when you move the window. And FTickableGameObject keeps ticking while everything else stops ticking.
I found out that IsTickableWhenPaused() is only used by objects in a level. My object is used by the GameInstance. So the IsPaused flag is always false for these objects even if the game is paused. I think that’s a bug but whatever.
The Game Mode is what stores the paused state. So I overrode SetPause() and ClearPause(). But it seems that when the window is moved, the game isn’t actually paused. At least, not through this mechanism. Yet all ticks stop except for FTickableGameObjects.
I’m at a loss how to fix this. How do I stop FTickableGameObjects from ticking when the window is being moved? I actually don’t care if things are paused or not. I just want consistent behaviour throughout all the tickable objects. Right now, my UI and game gets out of sync with each other when you move the window around.
Did some debugging and found out that when moving a window, all ticks do stop. The problem is when they resume. For Actors and widgets, the next tick is as normal and doesn’t include the time spent moving the windows.
For FTickableGameObject, the ticks do also stop. But when it resumes, the next tick has a delay that includes all the time spent moving the windows.
I think it has to do with stall events. It appears UI and Game Actors (rendering specifically) do get throttled, but not FTickableGameObjects. In fact, a lot of stuff doesn’t get throttled.
I guess I’ll just use the preview widget as the main game tick to handle timing.