Describe the bug
DontDestroyWithOwner is not working properly.
Giving ownership of an NetworkObject to the client and disconnecting does not return ownership of the NetworkObject to the server.
To Reproduce
- Set DontDestroyWithOwner to "true" and spawn a NetworkObject using the SpawnWithOwnership function.
- Repeat step 1 several times.
- Disconnects a client that has NetworkObject ownership.
- Only half of NetworkObject ownership is returned to the server.
Actual outcome
Only half of NetworkObject ownership is returned to the server.
Expected outcome
All NetworkObject ownership should be returned to the server.
Environment
- OS: Windows 10
- Unity Version: 2020.3.11f1
- MLAPI Version: v0.1.0
Spawn Script
var instance = Instantiate(prefab, transform.position, transform.rotation);
instance.GetComponent().DontDestroyWithOwner = true;
instance.GetComponent().SpawnWithOwnership(NetworkManager.Singleton.ConnectedClientsList.First().ClientId);
Disconnect Script
m_NetworkManager.StopClient();
Describe the bug
DontDestroyWithOwner is not working properly.
Giving ownership of an NetworkObject to the client and disconnecting does not return ownership of the NetworkObject to the server.
To Reproduce
Actual outcome
Only half of NetworkObject ownership is returned to the server.
Expected outcome
All NetworkObject ownership should be returned to the server.
Environment
Spawn Script
var instance = Instantiate(prefab, transform.position, transform.rotation);
instance.GetComponent().DontDestroyWithOwner = true;
instance.GetComponent().SpawnWithOwnership(NetworkManager.Singleton.ConnectedClientsList.First().ClientId);
Disconnect Script
m_NetworkManager.StopClient();