I'm making a game where a wall spawns and goes towards two players, two avoid the wall, the players have to press a number corresponding to a given number that is the same with both players. For some reason, the first wall has the same number, but the RPC doesn't get through to the other player for any of the other walls.
Code for Wall:
func _ready():
print('ready')
hide()
yield(get_tree().create_timer(0.3), "timeout")
show()
if Server.showing:
pass
else:
hide()
randomize()
num = randi()%4+1
if !Server.showing:
rpc("setNum",num)
print(num)
print(Server.showing)
remote func setNum(n):
num = n
$Num.text = str(num)
print(num)
print("recieve")
The Server.showing is the first player and the !Server.showing is the second player. Server is just a singleton.
Thanks for any help!