RCP having to know the target node ?

Godot Version



I got these errors from a RPC:

E 0:00:27:0642   get_cached_object: ID 2 not found in cache of peer 1.
  <Erreur C++>   Parameter "oid" is null.
  <Source C++>   modules/multiplayer/scene_cache_interface.cpp:278 @ get_cached_object()
E 0:00:27:0642   process_rpc: Invalid packet received. Requested node was not found.
  <Erreur C++>   Parameter "node" is null.
  <Source C++>   modules/multiplayer/scene_rpc_interface.cpp:212 @ process_rpc()

I really don’t know why.

Here is the code:

	### Server send back the array
	for i in current_place_players.size():
		for y in current_place_players[i][1].size():
#			for x in current_place_players[i][1][y]:
			if current_place_players[i][1][y][1] == player_id :
				rpc_id(player_id, "_receiving_place_and_rooms_players_and_infos", current_place_players)
				rpc_id(int(current_place_players[i][1][y][1]), "_receiving_new_player", current_place_players)

@rpc("authority", "call_remote", "reliable")
func _receiving_place_and_rooms_players_and_infos(current_place_players: Array) -> void : # Player receive place and rooms players
	for i in current_place_players.size():
		if current_place_players[i][0] == PlayerData.player_current_room :
			PlayerData.player_room_group = current_place_players[i][1]
	PlayerData.player_place_group = current_place_players

This code works fine at the game startup, later I free the scene and reload a new one resulting on errors and the rpc not reaching the client.

Any idea?

More tests and I found out that the second rpc (going to the other players and usinf the same func) works well and don’t make errors.
The issue is only occuring on the current player instance.