im trying to make a simple game wich is a multiplayer version of space invaders (to learn more about networking and whatsoever)
and i ran into this problem:
when i connect to the host the game crashes and an error pops up :
attempt to call function run_server_func on base null instance
here's my code
in the network autoload:
func call_peer(node_path, function, data):
rpc_unreliable("receive_call", node_path, function, data)
remote func receive_call(node_path, function, data):
get_tree().get_root().get_node(node_path).run_server_func(function, data)
in the player script:
func _physics_process(delta):
detect_player_movement()
network.call_peer("res://entities/Friend.tscn","move", position)
in the friend node(the character the other player is controlling):
func run_server_func(function, data):
if function == "move":
move(data)
func move(data):
position = data
thanks for taking a look it means a lot