I call it from client and server. Right now I do not have any dedicated server so I assign user as server. I already tried to use @rpc(“any_peer”), do not work for me
DB CLOSE, Clean closure: true
DB CLOSE, Clean closure: true
DB CLOSE, Clean closure: true
DB CLOSE, Clean closure: true
Wait for player!
Player connected298160685
Connected to server
Player connected1
DB CLOSE, Clean closure: true
DB CLOSE, Clean closure: true
Player to send:298160685 My id:1
Player to send:1 My id:298160685
I also checked by print(multiplayer.get_unique_id()) that “My id” is id who send data.
I found out problem. I removed my custom Player object from player
@rpc("any_peer")
func transfer_deck(player):
And now it provide such output:
DB CLOSE, Clean closure: true
DB CLOSE, Clean closure: true
DB CLOSE, Clean closure: true
DB CLOSE, Clean closure: true
Wait for player!
Connected to server
Player connected1
Player connected549206460
DB CLOSE, Clean closure: true
DB CLOSE, Clean closure: true
Player to send:1 My id:549206460
Player to send:549206460 My id:1
<EncodedObjectAsID#-9223371679365856040>
<EncodedObjectAsID#-9223371698676431656>
But still it need to be Player object not EncodedObjectAsID