File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 13
13
- object-behaviour-relation
14
14
- modularity
15
15
- networkedvar
16
+ - syncedvar
16
17
- scene-management
17
18
- object-ownership
18
19
- object-visibility
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : SyncedVar
3
+ permalink : /wiki/syncedvar/
4
+ ---
5
+
6
+ SyncedVars are simple ways to have syncronized fields in NetworkedBehaviours. SyncedVars are similar to NetworkedVars but have a few differences:
7
+
8
+ 1 . They are slower
9
+ 2 . They are less customizable
10
+ 3 . They only sync from server to client
11
+ 4 . They require less code
12
+ 5 . They support serialization
13
+
14
+ ### Example
15
+ Creating a SyncedVar is as easy as creating an attribute on the field. Note that properties are not supported.
16
+
17
+ ``` csharp
18
+ [SyncedVar ]
19
+ public float mySyncedFloat = 5 f ;
20
+ ```
21
+
22
+ ### Single Sync Values
23
+ If you want values to be synced only once (at spawn), the send rate can be set to a negative value.
You can’t perform that action at this time.
0 commit comments