-
Notifications
You must be signed in to change notification settings - Fork 456
Description
Description
com.unity.netcode.gameobjects/com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs
Lines 217 to 219 in ba30286
UpdateOwnershipTable(networkObject, NetworkManager.ServerClientId, true); | |
networkObject.OwnerClientId = NetworkManager.ServerClientId; |
When a client owner is removed UpdateNetworkProperties is called on the server with the previous OwnerClientId still set, which leads to wrong values in NetworkBehaviour.IsOwner, IsOwnedByServer and OwnerClientId
Not sure if a simple swap of lines 217 and 219 will introduce side effects, so I haven't created a pull request.
Reproduce Steps
Remove ownership from an object which is controlled by a client and has a NetworkBehaviour assigned.
Compare IsOwner etc. properties between NetworkObject and the behaviour on the server.
Actual Outcome
NetworkBehaviour properties aren't properly set on the server.
Expected Outcome
Correct owner is set in the NetworkBehaviours on the server after ownership is lost.
Environment
- OS: Windows
- Unity Version: 2021.1.24f1
- Netcode Version: 1.0.0