Multiplayer authority change

Im trying to change the multiplayer authority for my game in the middle of a match, but the remote rpc call doent execute, here’s the code and thanks in advance:

@rpc(‘any_peer’, ‘call_local’)
func change_auth()->void:
var my_peer=multiplayer.get_unique_id()
for target in targets:
target.set_multiplayer_authority(my_peer)
print(“El dueño es:”+str(target.get_multiplayer_authority()))
update_auth.rpc(my_peer)

@rpc(“any_peer”, “call_remote”)
func update_auth(my_peer)->void:
for target in targets:
target.set_multiplayer_authority(my_peer)
print(“El dueño es:”+str(target.get_multiplayer_authority()))
print(“Llega el código”+str(multiplayer.get_unique_id()))

btw, i dont know why i cant indent the code in the forum
image
srry, here’s a screenshot:

You need to press the </> button and paste in your code.

2 Likes

thanks

1 Like