making a triangle where the Y position of all 3 vertices are the same seems to make the triangle invisible. Not sure if i’m doing something wrong or if this is a bug.
this works fine.
local positions = {
Vector3.new(10, 1, 10),
Vector3.new(0, 2, 10),
Vector3.new(10, 3, 0)
}
but changing the Y position to 0 for all 3 vertices makes the triangle invisible and even makes the SpawnLocation
invisible
local positions = {
Vector3.new(10, 0, 10),
Vector3.new(0, 0, 10),
Vector3.new(10, 0, 0)
}
Adding a
HighLight
in the
SpawnLocation
makes it re-appear but the triangle won’t show. You also can’t see it in the wireframe view.
full code
local AssetService = game:GetService("AssetService")
local editableMesh = AssetService:CreateEditableMesh({Size = Vector3.one})
local positions = {
Vector3.new(10, 0, 10),
Vector3.new(0, 0, 10),
Vector3.new(10, 0, 0)
}
for i = 1, 3 do
editableMesh:AddVertex(positions[i])
end
editableMesh:AddTriangle(table.unpack(editableMesh:GetVertices()))
local function computeExtents(em: EditableMesh)
local verts = em:GetVertices()
if #verts == 0 then
return Vector3.zero
end
local inf = math.huge
local min = Vector3.new(inf, inf, inf)
local max = Vector3.new(-inf, -inf, -inf)
for _, id in verts do
local v = em:GetPosition(id)
min = min:Min(v)
max = max:Max(v)
end
return max - min
end
local meshPart = editableMesh:CreateMeshPartAsync(computeExtents(editableMesh))
meshPart.Anchored = true
meshPart.Position = Vector3.new(10, 10, 10)
meshPart.Parent = workspace
TriangleIssue.rbxl (53.3 KB)