Forge Developers | Slack Search | Trello Board Changelog
|
Forge Networking Remastered has been released!!! This is now listed in your Profile!
Go Back

Custom Networked MonoBehavior

Serializing Custom Instance Variables

With our system you are able to serialize any variables in your class (public, protected or private). This allows you to update your custom variables across the network. To do this you just need to send your variables getters and setters through the AddNetworkVariable method. Below is an example of a simple class that will update a variable across the network the "long" way.

Now that you have seen the "long" way of serializing your variables across the network, we can explore the "short" way which will achieve the same exact results through lambda expressions.

Serializing Variables from Other Components

Sometimes we do not have (or want to modify) other components (classes) that are on an object, yet, we still want to be able to send variables from those classes across the network. In this example I will be using the "short" (lambda) version of serialization, though the "long" form will work just as well here.

Notes About Serializing Variables

One of the main things about our network system is that the variables that you are serializing across the network are ONLY sent when they have been CHANGED. This means you save a lot on bandwidth! It is also important to note that all of the serialization that you do in this derivative of the NetworkedMonoBehavior is controlled by the throttle that you use for this class (the networkTimeDelay).

Title

Body

Title

Body


Input:

Title

Body


Input: