Help related to rpc in gd script

Godot Version

Replace this line with your Godot version

Question

#when im running a scene that contains this code

rpc_id(peer_id, “move”)

#and im running the project with the main scene that contains below code

@rpc(“any_peer”)
func move():
print(“:white_check_mark: Client received move()!”)

#the print statement is not beeing printed

#and im getting the following error

Unable to get the RPC configuration for the function “move” at path: “/root/rootnode”. This happens when the method is missing or not marked for RPCs in the local script.

#both the scripts are attached to the root nodes of their scenes and both the root nodes are named “rootnode”

#i first did it with different names and it was giving the same error
#i sat with ai for a day and did everything it suggested but still its not solved

#Thank you

From the docs

If a function is annotated with @rpc on the client script (resp. server script), then this function must also be declared on the server script (resp. client script). Both RPCs must have the same signature which is evaluated with a checksum of all RPCs. All RPCs in a script are checked at once, and all RPCs must be declared on both the client scripts and the server scripts, even functions that are currently not in use.

From your description it sounds like you are just calling an rpc that is not defined in the script, but only on the remote peer. If this is the case you just need to define move on the caller as well, even if it doesnt do anything.