Network State
Network Property
A Network Property is a C# property which is replicated across the network. For a property to be networked, the Attribute [Networked] must be added to it. An example of a networked property:
Supported C# Types
Int/UInt
Float
Bool
String
Enums
Byte
Long/ULong
Double
Supported Unity Types:
Vector2
Vector3
Quaternion
Color
Network Arrays
Network arrays are just like regular C# arrays, but their syntax is a bit different. They are defined using the NetworkArray generic class.
Example of a network array:
Custom Networked Structs
You can define custom structs that can be networked/replicated by adding the attribute [Networked] to them, like this:
Important notes:
Last updated
Was this helpful?