I want to generate the walls of the room by giving corner points of the room at runtime in unity


I want to generate a mesh at runtime by giving some points. The mesh should be like the walls of a room, which means it should have some height and some width for its walls. I have generated cubes between these points but they do not perfectly join on the vertices. When I generate a complete mesh through these points, the structure seems to not have any width and also its inner faces are see through.



Code:

// paste code here please

screenshot of a code editor
screenshot of a code editor
screenshot of a code editor