#How to store array of custom objects as godot primitive
1 messages · Page 1 of 1 (latest)
If you already have a serialize for a byte array of the objects, the easiest is to just use
var data: Array[PackedByteArray] = []
for obj in MyObjects:
data.add(obj.serialize())
or something like that
So you can send a typed array of PackedByteArrays
It's not the most optimal, but it works
Just deserialize them and create the objects on the other end
(This is all assuming a homogeneous array and one type of object per rpc)
(Otherwise you need to serialize the object type as well)