Skip to content

Commit

Permalink
Update sync-var-hooks.md
Browse files Browse the repository at this point in the history
Add description about timing of hook execution
  • Loading branch information
lucasmontec authored and James-Frowen committed Oct 8, 2024
1 parent 3163683 commit 5e2c7c6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions doc/docs/guides/sync/sync-var-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ event Action<int, int> event2;

The following is a list of rules that SyncVar hooks follows for when and where they are invoked:

- Hook only invoked if value is changed
- Hooks are only invoked if value is changed and after the value is updated

- When settings SyncVar
- both flags false
Expand All @@ -51,7 +51,8 @@ The following is a list of rules that SyncVar hooks follows for when and where t

- `DeserializeSyncVars` is never called on host sending update to itself, but is called when owner sends update to server

- hooks are invoked in `DeserializeSyncVars` if values changes
- always invokes if Only client (eg not host mode)
- Hooks are invoked in `DeserializeSyncVars` if values changes
- Always invokes if Only client (eg not host mode)
- Invoked after the variable is updated with the deserialized value.
- `invokeHookOnServer`
- invokes on server (eg when an change is send from owner)
- Invokes on server (eg when an change is send from owner)

0 comments on commit 5e2c7c6

Please sign in to comment.