Skip to content

NetworkObject ownership is not returned to the server. #1001

@junyeop

Description

@junyeop

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

  1. Set DontDestroyWithOwner to "true" and spawn a NetworkObject using the SpawnWithOwnership function.
  2. Repeat step 1 several times.
  3. Disconnects a client that has NetworkObject ownership.
  4. 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();

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions