Netcode - Exception: Type Unity.Collections.FixedString32Bytes is not serializable
Hello again!
I was following some good online tutorials, trying to learn :) But once again I am stuck with a problem without solution: I can't define a NetworkVariable of type string, like the ones suggested on those tutorials:
private NetworkVariable FixedString32Bytes displayName = new NetworkVariable FixedString32Bytes() (yeah, I know the <> are missing...);
This is the result:
Exception: Type Unity.Collections.FixedString32Bytes is not serializable - it must implement either INetworkSerializable or ISerializeByMemcpy Unity.Netcode.NetworkVariableSerialization`1[T].WriteValue[TForMethod] (Unity.Netcode.FastBufferWriter writer, TForMethod& value) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.8/Runtime/NetworkVariable/NetworkVariableSerialization.cs:92)
Good tutorial samples:
https://www.youtube.com/watch?v=OGVDIu7qOaE
https://www.youtube.com/watch?v=d1FpS5hYlVE
Anyone could help me with NetworkVariables and strings, please?
Thank you much!
Your answer
Follow this Question
Related Questions
Handling serialization of Transform (Unity / Mirror networking) 0 Answers
How to serialize a List of ContentPacks (from Morph3D) in Photon Unity Networking? 0 Answers
navmeshpath serialization via reflection for network RTS game 0 Answers
[Unet] How to Use SendBytesToPlayer? 1 Answer
"SerializationException: Unexpected binary element: 0" on Deserialization of struct 0 Answers