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

Open
#3,119 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, csharp, unity

Research direction

No source file or test is named. Reproduce quitting the game on Android, then compare the observed disconnect behavior with Windows; trace the Android application-quit lifecycle and the existing client disconnect path. Done means the server and other players are notified promptly and the player prefab is destroyed rather than waiting for heartbeat timeout.

Written by the indexing model from the issue text.

Description

stat:awaiting-response stat:imported type:bug
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
  • OS: Android
  • Unity Version: 6000.0.25f1
  • Netcode Version: 2.1.1
Additional Context

Specifically tested on:

  • Samsung galaxy J5 2017
  • Meta quest 2
Dominant language
C#
Stars
2.3k
Forks
461
Avg merge
3d 16h
Merged PRs (30d)
20

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Unity-Technologies/com.unity.netcode.gameobjects

All issues in Unity-Technologies/com.unity.netcode.gameobjects

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.