From 25edcf0d41a7068ee310fee0dd9e6d7031b211d8 Mon Sep 17 00:00:00 2001 From: Chris Langsenkamp Date: Sun, 23 Feb 2020 02:48:21 -0500 Subject: [PATCH] docs: Updated SyncVar docs --- doc/Guides/Sync/SyncVarHook.md | 1 + doc/Guides/Sync/SyncVars.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Guides/Sync/SyncVarHook.md b/doc/Guides/Sync/SyncVarHook.md index 26d77797a..f18061073 100644 --- a/doc/Guides/Sync/SyncVarHook.md +++ b/doc/Guides/Sync/SyncVarHook.md @@ -5,6 +5,7 @@ The hook attribute can be used to specify a function to be called when the SyncVar changes value on the client. This ensures that all clients receive the proper variables from other clients. - The Hook method must have a two parameters of the same type as the SyncVar property. One for the old value, one for the new value. - The Hook is always called after the value was set. You don't need to set it yourself. +- The Hook only fires for changed values, and changing a value in the inspector will not trigger an update. Below is a simple example of assigning a random color to each player when they're spawned on the server. All clients will see all players in the correct colors, even if they join later. diff --git a/doc/Guides/Sync/SyncVars.md b/doc/Guides/Sync/SyncVars.md index bd7679a11..90975d57d 100644 --- a/doc/Guides/Sync/SyncVars.md +++ b/doc/Guides/Sync/SyncVars.md @@ -8,7 +8,7 @@ The state of SyncVars is applied to game objects on clients before `OnStartClien SyncVars can use any [type supported by Mirror](../DataTypes.md). You can have up to 64 SyncVars on a single NetworkBehaviour script, including SyncLists (see next section, below). -The server automatically sends SyncVar updates when the value of a SyncVar changes, so you do not need to track when they change or send information about the changes yourself. +The server automatically sends SyncVar updates when the value of a SyncVar changes, so you do not need to track when they change or send information about the changes yourself. Changing a value in the inspector will not trigger an update. > The [SyncVar hook](SyncVarHook.md) attribute can be used to specify a method to be called when the SyncVar changes value on the client.