NodeRpc Method |
Sends a remote procedure call request for the given method to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same NodePath, including the exact same node name. Behaviour depends on the RPC configuration for the given method, see RpcConfig(String, MultiplayerAPIRPCMode). Methods are not exposed to RPCs by default. See also Rset(String, Object) and RsetConfig(String, MultiplayerAPIRPCMode) for properties. Returns an empty Variant.
Note: You can only safely use RPCs on clients after you received the connected_to_server signal from the SceneTree. You also need to keep track of the connection state, either by the SceneTree signals like server_disconnected or by checking SceneTree.network_peer.get_connection_status() == CONNECTION_CONNECTED.
Namespace: Godot
public Object Rpc( string method, params Object[] args )
[Missing <param name="method"/> documentation for "M:Godot.Node.Rpc(System.String,System.Object[])"]
[Missing <param name="args"/> documentation for "M:Godot.Node.Rpc(System.String,System.Object[])"]
[Missing <returns> documentation for "M:Godot.Node.Rpc(System.String,System.Object[])"]