2
\$\begingroup\$

I've ran in to an odd issue with my Unity3D game completely pausing in certain scenarios, even with the Run In Background player setting on.

For reference I'm on Windows 7 Ultimate using Unity 4.3.3

In The Editor: If I tab out of the editor while the game is running everything keeps working fine.

*In Windowed Mode:* If I'm running the standalone in windowed mode and tab out, everything keeps working fine.

However, if I grab the top bar on the window to move the window around, the game pauses until I release the window. Nothing updates, nothing runs while it's paused.

In Fullscreen Mode: If I'm running the standalone in fullscreen mode and alt+tab out the game pauses. Not resuming until I tab back in to the game.

This is causing issues with the multiplayer aspects of my game, because the client stops sending messages to the server whenever they alt+tab out or move the window.

I know the graphics device is getting lost when I tab out, because I get this error in my log:

HandleD3DDeviceLost HandleD3DDeviceLost: still lost Skipped rendering frame because GfxDevice is in invalid state (device lost)

But that should only cause the game to stop rendering, which is fine. I just need the update loop to continue.

| improve this question | | | | |
\$\endgroup\$
  • \$\begingroup\$ Are you setting it to run in the background via code or through preferences? \$\endgroup\$ – Grey Jan 17 '14 at 18:20
  • \$\begingroup\$ Through the player preferences. I tried through the code as well, and that didn't work. I've also confirmed that Application.runInBackground is set to true ingame \$\endgroup\$ – Timothy Williams Jan 17 '14 at 18:41
  • \$\begingroup\$ Hmm. I'm not sure what's going on. I've made a local multiplayer game in Unity before and this has never happened to me. It might be worth it to file with the Unity Dev Team. \$\endgroup\$ – Grey Jan 18 '14 at 21:38
  • \$\begingroup\$ Yeah I'll probably try sending that in, this is a very bad error I need fixed within the next week or two. I've tried it on fresh projects and it happens there as well \$\endgroup\$ – Timothy Williams Jan 19 '14 at 2:48
2
\$\begingroup\$

So turns out this was a Unity bug. I reported it to Unity and they confirmed it for me. Not much to do besides wait for the next update.

| improve this answer | | | | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.