- Home /
get terrain vertices?
Is there any way to get all the vertices of a terrain and assign into a List of vector3?
Answer by YetAnotherKen · Sep 07, 2019 at 02:36 AM
Yes, they are stored in the mesh, usually the mesh property of the meshFilter assigned to the terrain object. in there will be a vertices property.
I would do something like: [code] List myVertices = new List(); foreach (Vector3 vertex in meshFilter.mesh.vertices) { myVertices.Add(vertex); } [/code]
The problem is that in the object of the "terrrain", it does not contain meshfilter or meshRenderer.
if so, it would be easy to get the vertices ... That's why I'm looking for info, but I can't find anything useful!
Answer by harshiths037 · Mar 08, 2021 at 03:15 PM
@gonzalitosk8 did find out how to get vertex information