Skip to content

NetworkVariable is written to, but doesn't know its NetworkBehaviour yet. Are you modifying a NetworkVariable before the NetworkObject is spawned? #2147

@ezoray

Description

@ezoray

Description

I'm getting this warning when despawning a network object with Despawn(true) immediately after hiding the object from the client. It looks to relate to the fix that went in for #2143.

Reproduce Steps

Hide the object from client - object.NetworkObject.NetworkHide(clientId)
Despawn the object - object.NetworkObject.Despawn(true)

Actual Outcome

It looks like I get the above warning for each of the network variables in the object.

Expected Outcome

Object should despawn without warnings.

Environment

  • OS: macOS Big Sur
  • Unity Version: 2020 LTS
  • Netcode Version: develop

Additional Context

There may be more at play than the above, I've not reproduced it in a test project.

Metadata

Metadata

Assignees

Labels

priority:mediumThis issue has medium priority and may take some time to be resolvedtype:bugBug Report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions