rpc() between different projects doesn't work, but node paths are the same

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CX97

I am trying to make a multiplayer game, therefor I want to make a server programm and a different client programm. The rpc calls are made by preloaded scripts (same script name, same node name), but the other side doesn’t receive anything.
In the internet it’s always said that different Godot projects can communicate as long as the node paths of the rpc-sender and the rpc-receiver are the same. Does someone has an idea why it doesn’t work in my project?

Try making sure your firewall isn’t preventing the calls. Try running the client and server on the same machine to confirm networking issues like router portforwarding is not the issue to. That should help narrow down the problem

godot_dev_ | 2023-06-23 15:45

I tried to run the project on one and one two devices. Both didn’t worked. The programms connect, that’s sure, but sending rpcs is effectless.
I also tried to send calls in both directions (server → client and client → server) and already made an multiplayer game (but with one project for both server and client) which worked.

CX97 | 2023-06-23 17:10

hmm, maybe its a file version issue, where your trying to call a function of a script of client but it’s not the exact same script on server?

godot_dev_ | 2023-06-23 20:30

I solved the problem by coincidence: You need the same function called by the rpc on the server and on the client, even if it’s not called on the sender platform.

Example: if the client sends rpc_id(1, “test”) and it doesn’t have @rpc func test() it won’t work. But if you add this function to the client, even if the server or the client nerver calls it, the rpc is sended.

CX97 | 2023-06-24 07:59