I want to create a String network variable. I read online i could use FixedString64Bytes but when i try
private NetworkVariable<FixedString64Bytes> playerName = new NetworkVariable<FixedString64Bytes>();
i get following error message:
Type Unity.Collections.FixedString64Bytes is not serializable - it must implement either INetworkSerializable or ISerializeByMemcpy
I also tried creating a custom struct, but i get an error in the SerializeValue line(the constraints for type arguments are not satisfied), which is weird because i copied this code from a youtube tutorial)
public struct NetworkString : INetworkSerializable
{
private FixedString32Bytes info;
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
{
serializer.SerializeValue(ref info);
}
What is the best way to send strings through network variables?
thank you in advance