Skip to content

NetworkVariable with both Read&Write Permission set to Owner doesn't have its Value updated to Server #2094

@sianzhan

Description

@sianzhan

Description

Network Variable with both ReadPerm = NetworkVariableReadPermission.Owner and WritePerm = NetworkVariableWritePermission.Owner doesn't have the value updated from Owner Client to Server.

Reproduce Steps

  1. Declare a NetworkVariable of any type T with both Read & Write Permission set to Owner.
    i.e. new NetworkVariable(default, NetworkVariableReadPermission.Owner, NetworkVariableWritePermission.Owner)
  2. Have two instance of game running, one join as Host, another one join as Client.
  3. Attempt to update the NetworkVariable on the Owner Client.
  4. Print out the resulting NetworkVariable Value on Server.

Actual Outcome

The Value of NetworkVariable has been updated on the Owner Client side, but on the Server side, it remains the default value.

Expected Outcome

The Value of NetworkVariable on the Server side should be synced to the Value of Owner Client side, according to netcode documents (https://docs-multiplayer.unity3d.com/netcode/current/basics/networkvariable/index.html) as well as the comment inside "NetworkVariableReadPermission.cs" (Line 13: /// Only the owner and the server can read).

Environment

  • OS: Windows10
  • Unity Version: 2021.3.6 LTS
  • Netcode Version: Version 1.0.0 - June 29, 2022
  • Netcode Commit: -

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