Skip to content

Commit 760921f

Browse files
committed
Fix naming in networkvariable.md doc
1 parent 8c6fc0e commit 760921f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

com.unity.netcode.gameobjects/Documentation~/basics/networkvariable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ This works the same way with dynamically spawned NetworkObjects.
145145

146146
The [synchronization and notification example](#synchronization-and-notification-example) highlights the differences between synchronizing a `NetworkVariable` with newly-joining clients and notifying connected clients when a `NetworkVariable` changes, but it doesn't provide any concrete example usage.
147147

148-
The `OnValueChanged` example shows a simple server-authoritative `NetworkVariable` being used to track the state of a door (that is, open or closed) using an RPC that is sent to the server. Each time the door is used by a client, the `Door.ToggleServerRpc` is invoked and the server-side toggles the state of the door. When the `Door.State.Value` changes, all connected clients are synchronized to the (new) current `Value` and the `OnStateChanged` method is invoked locally on each client.
148+
The `OnValueChanged` example shows a simple server-authoritative `NetworkVariable` being used to track the state of a door (that is, open or closed) using an RPC that is sent to the server. Each time the door is used by a client, the `Door.ToggleStateRpc` is invoked and the server-side toggles the state of the door. When the `Door.State.Value` changes, all connected clients are synchronized to the (new) current `Value` and the `OnStateChanged` method is invoked locally on each client.
149149

150150
```csharp
151151
public class Door : NetworkBehaviour
@@ -180,7 +180,7 @@ public class Door : NetworkBehaviour
180180
}
181181

182182
[Rpc(SendTo.Server)]
183-
public void ToggleServerRpc()
183+
public void ToggleStateRpc()
184184
{
185185
// this will cause a replication over the network
186186
// and ultimately invoke `OnValueChanged` on receivers

0 commit comments

Comments
 (0)