What's the difference Between rpc("myFunction") and myFunction.rpc()

Godot Version



I’m Learning the Godot networking and I can’t figure what are the use cases of rpc(“myFunction”) and myFunction.rpc() and why are they different

They are essentially the same but they do take different paths.

Calling rpc(“foo”) uses the Node path.

Calling foo.rpc() uses the Callable path.

I had a little trouble following the callable path using GitHub on my phone, but RPC will make it’s way to the multiplayer API instance for packet prep on the packet peer.

It would seem like you could potentially have a callable class function that is configured a certain way and passed around. But I haven’t confirm that.