I’m having some problems when copying vertices from one mesh to another.
This works:
new_mesh.vertices = old_mesh.vertices.Clone();
But this don’t:
new_mesh.vertices = new Vector3[old_mesh.vertices.Length];
Array.Copy(old_mesh.vertices, new_mesh.vertices, old_mesh.vertices.Length);
Can someone explain why this is the case? I’m rather new to C# but from what I can tell the Vector3 is a struct so the vertices should be stored as values and not as references in the array.