Does it work in earlier versions than Unity 2019.3? Serialzation was worked on in 2019.3, perhaps you found a regression, therefore please check if this problem is new to 2019.3.
You can’t serialize Vector3 or any Unity Classes in a Save File.You can only serialize datatypes such as float,int,byte etc.You can also serialize their arrays.
You will have to create your own custom classes that inherits from the UnityClass you want to serialize and Add Attribute on it [System.Serializeable].
For more Info You can watch this Video.
Vector3, Vector3[ ] and List<Vector3> can all be serialized, I never had a problem with that.
Please create an example script that shows what you’re doing. Please check if this works in earlier Unity versions than 2019.3, because you post this in the beta forum and I’m trying to figure out whether this is a new issue in 2019.3.
Also clarify what “serialization” means in your specific case. Do you use Unity’s serialization system or a custom solution?
[System.Serializable]
public class FragmentMeshData
{
public int verticesPerLine = 0;
public Vector3[] vertices = null;
public int[] triangles = null;
public Color[] colors = null;
public int triangleIndex = 0;
public int VectorIndex = 0;
public int ColorIndex = 0;
}
I want to highlight that every other class without Vector3, Color etc. works well.
If I remove those things:
[System.Serializable]
public class FragmentMeshData
{
public int verticesPerLine = 0;
//public Vector3[] vertices = null;
public int[] triangles = null;
//public Color[] colors = null;
public int triangleIndex = 0;
public int VectorIndex = 0;
public int ColorIndex = 0;
}
OK, so you’re not using Unity’s serialization system.
Now for the third time: Since you posted this in the beta testing forum, please figure out if this issue is related to the beta version. Does it work in Unity 2019.2 for example? If it’s not related to the beta, you have better chances to get an answer in a different sub-forum, then we can ask a moderator to move the thread, so you get help faster.
Like I said In Serialization (only) use array of float of length 3 for x,y,z instead of Vector 3
as was in the above video
Because The System doesn’t recognize Unity datatypes such as Vector 3 etc