Description
NetworkAnimator does some setup in OnNetworkSpawn that is behind a check of if (IsOwner || IsServer)
If a client spawns a NetworkAnimator without ownership and then later receives ownership, this setup is never done, which leads to errors.
I believe a simple fix could be to do the necessary setup in OnGainedOwnership
Reproduce Steps
- Spawn an owner authoritative
NetworkAnimator with the server as the owner
- Change the ownership of the
NetworkAnimator to a non-host client
- Errors are thrown every frame as a result of null member variables
Actual Outcome
Owner Authoritative NetworkAnimators throw errors when changing ownership to a another client.
Expected Outcome
Owner Authoritative NetworkAnimators should properly set up when given ownership.
Environment
- OS: Windows 10
- Unity Version: 2021.2
- Netcode Version: 1.0.0
Description
NetworkAnimatordoes some setup inOnNetworkSpawnthat is behind a check ofif (IsOwner || IsServer)If a client spawns a
NetworkAnimatorwithout ownership and then later receives ownership, this setup is never done, which leads to errors.I believe a simple fix could be to do the necessary setup in
OnGainedOwnershipReproduce Steps
NetworkAnimatorwith the server as the ownerNetworkAnimatorto a non-host clientActual Outcome
Owner Authoritative
NetworkAnimators throw errors when changing ownership to a another client.Expected Outcome
Owner Authoritative
NetworkAnimators should properly set up when given ownership.Environment