why this wont work?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By axilirate
func _on_send_pressed():
if not get_tree().is_network_server():
	network.recive(id)

network.gd

func recive(id):
	print("client send")
	rpc_id(1,"send")
	print(info)
	
remote func send(id):
	info = "haha"
	print("changed")

does not print (“changed”)

I want the player receive a var inside the servers node.

i think it should be
rpc_id(1,"send", id)

instead of

rpc_id(1,"send")

supper_raptor | 2020-04-05 09:56

removed the id from func send(id):

and it worked I guess.

axilirate | 2020-04-05 10:03

nope never mind, it doesnt work when the godot debugger is the client.
it only works when the debugger is connected to the server(the server is running on executable in this situation).

axilirate | 2020-04-05 10:05

Updated network.gd

  func recive(id):
	rpc_id(1,"send",id)
	print(info)
	
remote func send(id):
	#server
	print(id)
	print("sent to server")
	rpc_id(id,"send")

remote func recive_from_server():
	info = "haha"
	print("changed")
	
func join_game(id):
	print(get_tree().get_network_connected_peers())
	pass

the client doesn’t recive print("changed")

axilirate | 2020-04-05 10:30

If you are new to networking or learning godots networking i recommend http://kehomsforge.com/tutorials/multi/gdMultiplayerSetup/ site it really helped me to understand networking.

supper_raptor | 2020-04-05 10:32

Thanks! this is super useful.

axilirate | 2020-04-05 11:15