![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | mdswamp |
hi, i use RPC method to send animation to other player screen, the problem is that when i press a key in player1 screen which belongs to player1, it works properly. but when i press the same key in player2 screen, it works again. what should i do to fix this problem?
func _input(event):
if event.is_action_pressed("shoot"):
right_shoot()
rpc("right_shoot")
slave func right_shoot():
do_something
and this is the codes belong to stage (player 1 and 2 instance to stage node)
func _ready():
if (get_tree().is_network_server()):
player2.set_network_master(get_tree().get_network_connected_peers()[0])
else:
player2.set_network_master(get_tree().get_network_unique_id())
(it is one on one game)