Question

I made a water swirl and surface mesh in unity by script, and now I need to add wall which is a simple mesh. But I don't know how to add another mesh though. I wanted to find something like meshfilter.addmesh, but there is no such methods though. I 'm wondering how can I add another mesh or mesh filter to add that wall. I use C# btw.

Was it helpful?

Solution

From the description of your problem (which is not clear enough) it looks like you should create another game object with MeshFilter and MeshRenderer components (you can do it either by hands or by script) for your wall.

If for some reason you REALLY want to have several meshes in one MeshFilter then your only option is to use submeshes (see Mesh.subMeshCount, Mesh.SetIndices, Mesh.SetTriangles, Renderer.materials and maybe Mesh.CombineMeshes).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top