Bind Event to Application Will Enter Background Delegate happens when going back in game

Hi,

I’m working on an idler game so I need to save variables whenever the player switches app (like he gets a message and switch to that app to answer). So once the player gets back in game, I load the saved variables and update them based on the time he spent on the another app.

I was quite happy to see that two nodes exist for that which are “Bind Event to Application Has Entered Foreground Delegate” and “Bind Event to Application Will Enter Background Delegate”.
And here’s what I did to test if this works :


I’m just using print string to see if that works.

The first time I launch the game, I see GAMEINSTANCE - LOAD, then i switch app, wait like 5 seconds and come back in game and then I see GAMEINSTANCE - LOAD and GAMEINSTANCE - SAVE, but, they both “disapear” at the same time meaning they’ve been fired at the same time (they both should last 20 seconds but the save message should have fired 5 seconds (or whatever time I spent in an other app) before.

Am I missing something here or using the wrong node ?
I tried to do that in Game Instance, Plateform Game Instance and Game mode, they’re all doing the same thing :frowning:

Anyway, thanks in advance =)

Hi! I’m having exactly the same issues : both events fire when waking up the device. When I press the power off button to put it to sleep the event isn’t fired then.
I’m using unreal 4.26 and it’s on a Pico 3 VR headset. I wanted to use the delegates to pause our app whenever it wasn’t in focus.

Anyone had a similar issue/fix/workaround? Thanks!