for some reason, when I have to delete some procedural mesh and write a new one over it, the old one doesn’t disappear, even when I do destroyimmediate. with fixed update, and clear()… the mesh is still there!
function renewMesh();{
var meshy = GetComponent(MeshFilter).sharedMesh;
DestroyImmediate(meshy, true);
yield WaitForFixedUpdate();
var mesh : Mesh = GetComponent(MeshFilter).mesh;
mesh.Clear();// Clears all the data that the mesh can contain previously.
geometry= new Mesh();
GetComponent(MeshFilter).mesh = geometry;
ConstructMesh();//function makes fine mesh on first time only and then shows only first mesh that was destroyed and not new one?
}