Hello everyone. I’m developing multiplayer game for android.
When the phone received a phone call(or something like that, etc) during gameplay, the game becomes not active and automatically pauses. It’s ok.
But I’m developing a multiplayer game and it is pausing on only one device (for example, if the sever phone receives a phone call, only the server is paused and the client is not paused. If a client phone receives a call, the server is not pausing).
What I want to do is pause both the server and client phone when the game becomes inactive on one of the devices.
Is there a way to detect the inactivity(not sure how to call) of the game with blueprints?
You could poll Is Game Paused and dispatch a Set Game Paused call to your server/clients. Unfortunately, there doesn’t seem to be a dedicated On Paused/Unpaused event that triggers when it happens, so you’ll have to periodically check it yourself (on a Timer, on Tick or similar).
Thank you very much for your quick reply. Do I need to check isGamePaused with timer and if it is true, do I have to run a method to pause for both devices?
As naive approach, yes, you’d have to check it on a timer and whenever it changes (you want to know Running -> Paused and Paused -> Running, right?) you call a server authoratative BP function that pauses/unpauses on the server/clients - at least thats what I’d do with the information you gave me.