Saving a copy of original vertices?

Hi,

So I’ve been trying to get some world generation to work, using a geosphere and a script to modify its vertices. The way I do this tho, I can’t seem to reset the mesh to its original state, for when I want to generate a new world.

I’ve tried saving a copy of the vertices in awake, but it would seem that every time mesh.vertices gets updated, the copy gets updated as well.
No clue why tho.

I guess I could duplicate the whole mesh with instantiate and reset it to that mesh’s vertices, but that would mean I’d have a whole lot of extra data I don’t need, right?

So, is there any way to save a copy of JUST the original vertices?

Thanks in advance,

Nick

I think you’re probably using

newVertices = originalVertices;

Instead use

System.Array.Copy(sourceVertices, destVertices, sourceVertices.Length);

See this thread…

http://forum.unity3d.com/threads/comparing-arrays-if.255934/