- Edited
Hello again. I cant seem to understand what is going wrong here.
Godot 4.3. I was happy to announce that converting object to bytes an back worked for the RPC but it does not.
Problem is this.
extends Resource
class_name PlayerData
var id: int
var player_name:String
var is_server:bool
var score: float
I have a dic of PlayerData
var player_list: Dictionary
The principle is this -> peer connected -> sends rpc to server to add_player()
-> Server then sends to every player/peer RPC to create local players -> players are locally created in all peer instances.
But it seems that data is null..
In the server part i send bytes -> dictionary converted to bytes. The dictionary contains 2 players. So far so good.
Then in the local part 'add_local_players()` i get the dic bytes, then i convert back, but its not exact.
Bytes
Dic
id
is correct
But here the data is null..
the casted player_obj
from dictionary is null, not exactly null it just dont have the correct values.
And in the end no players gets added, even tho i have received bytes and converted them to dictionary..
Can someone has any idea why am i wrong here?