Unity-Technologies / com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.15k stars 435 forks source link

Closing the game on Android doesn't properly disconnect the client #3119

Open SubatomicPlanets opened 1 week ago

SubatomicPlanets commented 1 week ago

Description

On Android, when quitting the app, the server and other players don't get notified. Eventually it will time out due to heartbeats, but that is not ideal. When quitting the game on other platforms, such as Windows, it correctly notifies the server, and the player prefab gets destroyed.

Environment

Additional Context

Specifically tested on:

Moe-Baker commented 3 days ago

As far as I know, this is a limitation of mobile operation systems, android will instantly freeze the app when put in the background and will terminate the process nearly instantly as well when the user closes the app. I'm interested if there is a workaround for this tho.