RPCs (Remote Procedure Calls)
RPCs allow you to invoke functions across the network, enabling communication between the server and clients. These examples are parameterless, but of course they can contain parameters.
Run on Server
Use the [UFunction] attribute with FunctionFlags.RunOnServer to indicate that a method should be executed on the server:
Run on Owning Client
Similarly, to execute a function on the owning client, use FunctionFlags.RunOnClient:
Multicast
For functions that should be executed on both the server and all clients, use FunctionFlags.Multicast:
Last updated