+2 votes

Is it possible to allow RPC from the server on clients even if they are network master locally?
I'm trying to call this function on the client:

remote func set_pos(new_pos : Vector2):
    position = new_pos
    rset('slave_position', new_pos)

from server:

func _on_player_connected(id):
    print('Player with id ' + str(id) + ' connected')
    rpc_id(id, 'set_pos', $'/root/Node2D/Spawns/Spawn1'.position)

(this function is connected to network_peer_connected)
but I'm getting this error on client:

RPC 'set_pos' is not allowed from: 1. Mode is 0, master is 1.

If this is not possible, what is the best way to allow the server to control clients?

asked Apr 15 in Engine by Burto (14 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.