Execution Table
The following table details the execution of ServerRpc
and ClientRpc
functions:
Function | Server | Client | Host (Server+Client) |
---|---|---|---|
ServerRpc Send | |||
ServerRpc Execute | |||
ClientRpc Send | |||
ClientRpc Execute |
An RPC function typically doesn't execute its body immediately since the function call is a stand-in for a network transmission. Since the host is both a client and a server, local RPCs targeting the host-server or host-client are invoked immediately. As such, avoid nesting RPCs when running in host mode as a ServerRpc method that invokes a ClientRpc method that invokes the same ServerRpc method (and repeat...) can cause a stack overflow.
Structure of a typical ServerRpc
:
Pseudo-code sample of a ServerRpc
:




