Hello, I've recently been working on procedurally generating terrain with Arraymesh. That's going well, but now I need to assign the mesh multiple different materials. I found set_surface_material(), but that didn't seem to work. Does anyone know how to do this?
Arraymesh materials
I might actually switch to multimesh, I think it suits my purpose better. But if anyone knows about arraymesh materials, it would still be good to know. Arraymesh is sadly un-documented.
ArrayMesh works (in my limited experience) -- my current workflow is basically
(pseudo C#) ArrayMesh m = new ArrayMesh() //for each surface + material we want ... m.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, data) int surfaceIndex = m.GetSurfaceCount() - 1 m.SurfaceSetMaterial(surfaceIndex, material)
///next surface
I didn't know you had to call add_surface_from_arrays() for each material. That also clears up what a "surface" is. Thanks!