I read somewhere that pointers are not possible with Unity, so maybe that’s old information, or there’s another way around this problem.
I’m trying to make an undulating mesh, kind of like the surface of water.
I’ve got a X-by-Z grid of vertices that I’ve set up, triangulated, and added to a mesh.
Currently I’ve given them random Y positions.
To easily go through their Y positions and change them in Update(), I really want to set up the vertices with pointers. Something like:
vertices _= new Vector3(xPos, *heightMap*, zPos);*_
Is this not possible?
The only way I can think of doing it now is to go through the Object’s Mesh component’s vertices and recreating the vertex data every frame with new calls to Vector3.
Is there a better way?