Description
When a player joins my host game, and that player exits the session, OnNetworkDespawn() will not be called on the host for that player.
Reproduce Steps
- Have a simple network game that spawns players
- Have player join a host game in progress
- Have that player exit the game
- Notice that OnNetworkDespawn for that player is not called on the host's machine
Actual Outcome
OnNetworkDespawn() will be called for the host player when the game exists, but if a client joins and exits the game, OnNetworkDespawn() will not be called on the host for that client player.
Expected Outcome
When a client leaves the game, OnNetworkDespawn() is called on the player object on the host.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
- OS: Windows 10
- Unity Version: 2021.3.22f1
- Netcode Version: 1.2.0
- Netcode Commit: N/A
Additional Context
Players are spawned automatically via Network Manager. They are added to the list of Network prefabs in the editor. On the host, OnNetworkDespawn() is being called for the host's player when the host game exits. It isn't being called on the host when players from other clients leave the host's session.
A current workaround is to override OnDestroy() instead.
Description
When a player joins my host game, and that player exits the session, OnNetworkDespawn() will not be called on the host for that player.
Reproduce Steps
Actual Outcome
OnNetworkDespawn() will be called for the host player when the game exists, but if a client joins and exits the game, OnNetworkDespawn() will not be called on the host for that client player.
Expected Outcome
When a client leaves the game, OnNetworkDespawn() is called on the player object on the host.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional Context
Players are spawned automatically via Network Manager. They are added to the list of Network prefabs in the editor. On the host, OnNetworkDespawn() is being called for the host's player when the host game exits. It isn't being called on the host when players from other clients leave the host's session.
A current workaround is to override OnDestroy() instead.