Replicating Variables

Just as Actors and Functions can replicate over the network, so can Variables. Variables that are important to gameplay should only be modified on the Network Authority (Server) and then replicated to Remote Machines (Clients) on a need-to-know basis. Clients should not alter the values of replicated variables, even in their construction scripts, as local modification of replicated values can lead to out-of-sync experiences.

You can designate a variable as Replicated, which means the variable replicates a copy of its value from the Server to Clients. If there is code that needs to run in response to a change in the variable's value, use the RepNotify feature. This feature provides a function that will execute, on both server and client machines, whenever the variable updates.

Implementation Guides