To declare a function as an RPC, you simply need to add
NetMulticast keywords to the
For example, to declare a function as an RPC that will be called on the server, but executed on the client, you would do this:
UFUNCTION( Client )
To declare a function as an RPC that will be called on the client, but executed on the server is very similar but uses the
UFUNCTION( Server )
There is another special type of RPC function type called Multicast. Multicast RPCs are designed to be called from the server, and then executed on the server as well as all currently connected clients.
To declare a multicast function, you simply use the
UFUNCTION( NetMulticast )
Multicast RPCs can also be called from clients but will only execute locally in this case.