Skip to content

Owner Authoritative NetworkAnimator does not work properly when ownership is assigned after spawning #2126

@dunorb

Description

@dunorb

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

  1. Spawn an owner authoritative NetworkAnimator with the server as the owner
  2. Change the ownership of the NetworkAnimator to a non-host client
  3. 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

Metadata

Metadata

Labels

priority:highThis issue has high priority and we are focusing to resolve itstat:importedStatus - Issue is tracked internally at Unitytype:bugBug Report

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