Host can't trigger rpc on peer

Godot Version

` 4.3

Question

Hi, I’ve been using Godot for about six months, and I have a problem that I’ve been trying to solve for days. I created a board game where the players don’t spawn new nodes; instead, they are assigned to one of the cameras around the board.

The problem is when a peer moves and occupies a new cell. The host receives that information and can’t move to that cell with their figures. However, when Player 1 moves a figure to a new cell, the peer doesn’t get that info and can still move their figure to an already occupied cell.

Here’s the function:

@rpc("any_peer", "call_local", "reliable")
func mark_next_cell_unavailable(grid_position):
	var next_position = grid_position + Vector3(-1, 0, 0)
	if Main.arena_positions.has(next_position):
		Main.arena_positions[next_position] = "unavailable"

When I added print statements for testing, I noticed that when the peer marks a cell as unavailable, I get two prints—one from the host and one from the peer. But when the host does it, I only see one print, which is why I believe the host isn’t triggering it on the peer.

how do you call this method? and where did you put the print statements?

like this :

		if event.is_action_pressed("ui_move_forward") and is_position_available(static_node_figure):
			whichevent = event
			mark_current_cell_available(static_node_figure)
			rpc("mark_next_cell_unavailable",static_node_figure.grid_position)

Print statment was like this :

@rpc(“any_peer”, “call_local”, “reliable”)
func mark_next_cell_unavailable(grid_position):
var next_position = grid_position + Vector3(-1, 0, 0)
print(“next cell is unavailable”, Main.arena_positions.has(next_position))
if Main.arena_positions.has(next_position):
Main.arena_positions[next_position] = “unavailable”

can you try the new way of calling rpcs?

mark_next_cell_unavailable.rpc(static_node_figure.grid_position)

didn’t know that…I thought that was the “old” way :sweat_smile:
I change it but result is the same…