How can I pause everything in the game except the GameInstance?
This is a mobile game so it also should be a cheap method.
Custom time dilation for each actor is an expensive method but it doesn’t work for me because GameMode doesn’t get affected from CustomTileDilation variable. I use GetGameMode node and connect it to SetCustomTimeDilation(0) node but it doesn’t actually set it.
So, I can pause everything except GameMode and GameInstance but I can’t pause GameMode with this method. It probably doesn’t implement CustomTimeDilation varibale correctly, it looks like a bug.
Yes GameInstance doesn’t tick every frame by itself but there are timers inside GameInstance that are ticking.
For example there is a socket connection module inside it. It should send connection validation to server every 5 seconds, fired by a timer. But that timer doesn’t fire if I pause the game or set time dilation to 0.
I just tried your suggestion. But it didn’t work out.
I set GameState as ticking even when paused.
Fired event from GameState every second.
Followed the string printed from GameInstance.
Result: Timer in the GameState stops when I pause the game.
EDIT: I managed to get it fired by using it inside Event Tick. I added WorldTickTime to a float and every time it exceeds 5, I fired the event and works fine now. Thanks for your help!