Description
Description
Hi! guys! I just upgrade to Netcode preview 9, and found a strange behaviour.
I had a network behaviour object that will switch ownership from server to client.
But the network behaviour on the server side will trigger OnGainedOwnership even when it lost owner from server.
This happen on Netcode preview 9 only.
I was using Netcode preview 5 before upgrading.
Reproduce Steps
1.Create Empty Unity Project
2.Donwload Netcode preview 9 package
3.Create a Script and inherit from Network Behaviour
4.Create a method with attribute like this : [ServerRpc (RequireOnwership = false)]
5.Within method from step4, I switch it's ownership by typing "GetComponent().ChangeOwnership( clientID )"
6.Create a override OnGainedOwnership method
Actual Outcome
Server side trigger OnOwnershipLost at first and OnGainedOwnership was trigger right after that.
Client side was fine.
Expected Outcome
After transport ownership from server to client, the client side should receive OnGainedOwnership, and server should only trigger OnLostOwnership
Screenshots
Environment
- OS: Mac
- Unity Version: 2021.3.1
- Netcode Version: 1.0.0-pre.9