Disconnect player when closing app

Hi,

On iOS and android, my player is not disconnected when the button "home" is pressed.

How can I do that ?

Thanks a lot.

Best regards,

AB

Comments

  • I think Unity has a callback/event method it calls when Home is pressed. Implement that and call Disconnect in that method. That should do the trick if it's possible to still send anything.
  • I did it. The method is called but the app is closed.
    So the disconnect is effective when the App is re open...

    You see what I mean ? :(

    Thank you !!
  • Get 2 players in a room and display how many are in there. Then press home on one and watch the other.
    Does it reduce the player-count immediately or only after a several seconds?
  • It's not reduce immediately.

    Sometimes it takes several minutes.

    That's the point.

    Thank you very much for your help.

    Best regards,

    AB
  • It is very odd that the disconnect should not go out in that case. It should be sent immediately.

    You have the issue on both Android and iOS?
    Whats your average ping?
    Which callback of Unity do you use to Disconnect when Home is pressed?