Hello @Anthony#1,
Thank you for your patience and for helping us debug this issue.
I've applied the changes you suggested, but unfortunately, we're still not seeing the new behavior take effect. Specifically, the exterior walls are still not generating correctly or appearing in the right position. You may notice this in the images I shared in our previous conversation as well.
In the code snippet you provided for drawing contours, we assume the vector Vec = end - start, which we applied. However, in our case, the exterior walls are not being generated at all—only duplicate colliders for doors and windows are created, and their meshes are missing (as you can see in the attached screenshot).
Currently, I’ve attached the updated code with your changes applied:
`
public void InitializeSingleWall(Vector3 start, Vector3 end, float height)
{
innerRoomPoints = new List<Vector3> { start, end };
normalRoomPoints = new List<Vector3> { start, end };
openings = new List<GenericOpening>();
GenerateSingleWall(start, end, height);
floor.mesh = null;
ceiling.mesh = null;
}
public void GenerateSingleWall(Vector3 start, Vector3 end, float height = 3f)
{
float thickness = AppController.Instance.exteriorWallThickness;
Vector3 dir = (end - start).normalized;
Vector3 offset = Vector3.Cross(dir, Vector3.up).normalized * (thickness * 0.5f);
Vector3 p0Inner = start + offset;
Vector3 p1Inner = end + offset;
Vector3 p0Outer = start - offset;
Vector3 p1Outer = end - offset;
Vector3 vec = end - start;
// Build outer wall mesh
var outerOpenings = GetOpeningsBetweenPoints(openings, p0Inner, p1Inner, p0Outer, p1Outer);
MeshDraft outerWall = CreateWallWithOpening(p0Outer, p1Outer, height, outerOpenings, false, thickness);
// Build inner wall mesh (flip normals inward)
var innerOpenings = GetOpeningsBetweenPoints(openings, p0Outer, p1Outer, p0Inner, p1Inner);
MeshDraft innerWall = CreateWallWithOpening(p0Inner, p1Inner, height, innerOpenings, true, thickness);
// Combine into one mesh draft
MeshDraft md = new MeshDraft { name = "SingleWallSegment" };
md.Add(outerWall);
md.Add(innerWall);
md.Paint(SpaceVertexColor);
List<Vector2> clip = new List<Vector2>
{
new Vector2(0, 0),
new Vector2(0, height),
new Vector2(vec.magnitude, height),
new Vector2(vec.magnitude, 0)
};
MeshDraft windowFrame = MathUtils.Extrude(clip, Vector3.back, thickness, false);
windowFrame.Rotate(Quaternion.FromToRotation(Vector3.right, vec.normalized));
windowFrame.Move(p0Inner);
md.Add(windowFrame);
// Assign to mesh filter & collider
InitSeparateWallsList(1);
MeshFilter mf = GetOrCreateSeparateWallMeshFilter(0);
Mesh mesh = md.ToMesh();
mf.mesh = mesh;
// Add or update collider
MeshCollider mc = mf.GetComponent<MeshCollider>();
if (mc == null)
mc = mf.gameObject.AddComponent<MeshCollider>();
mc.sharedMesh = mesh;
}
MeshDraft windowFrame = MathUtils.Extrude(clip, Vector3.back, thickness, false);
windowFrame.Rotate(Quaternion.FromToRotation(Vector3.right, vec.normalized));
windowFrame.Move(p0Inner);
md.Add(windowFrame);
// Assign to mesh filter & collider
InitSeparateWallsList(1);
MeshFilter mf = GetOrCreateSeparateWallMeshFilter(0);
Mesh mesh = md.ToMesh();
mf.mesh = mesh;
// Add or update collider
MeshCollider mc = mf.GetComponent<MeshCollider>();
if (mc == null)
mc = mf.gameObject.AddComponent<MeshCollider>();
mc.sharedMesh = mesh;
}
`
Additionally, we’ve noticed that the package creates two types of walls:
One set is a child of ProceduralBuilding, which appears to be the combined mesh for all walls in the scene.
The second set includes individual wall segments, which are children of the Walls(-go) object under the RoomControllerPrefab.
From what I understand, you're generating two quads for each wall—possibly for rendering them from different angles—and you also add a mesh for the wall's thickness (which may be what creates the exterior visual). Please correct me if I’ve misunderstood this.
Could you please provide some insight into:
Why these two wall types are separated?
How this affects rendering or physics (e.g., colliders)?
Whether this design impacts mesh generation for exterior walls?
Any clarification would help us better align with your intended architecture and resolve this issue effectively.
Thanks again for your support.
Link To the Image