EditableMesh bad script or engine bug?

So this happens. Sorry but I cannot open draft post in bug section.
robloxapp-20241226-1704464.wmv (1.8 MB)

local AssetService = game:GetService("AssetService")
local editableMesh = AssetService:CreateEditableMesh()

local v1 = editableMesh:AddVertex(Vector3.new(0,0,0))
local v2 = editableMesh:AddVertex(Vector3.new(5,10,5))
local v3 = editableMesh:AddVertex(Vector3.new(-5,10,5))
local v4 = editableMesh:AddVertex(Vector3.new(-5,10,-5))
local v5 = editableMesh:AddVertex(Vector3.new(5,10,-5))
local v6 = editableMesh:AddVertex(Vector3.new(0,20,0))

editableMesh:AddTriangle(v2,v3,v1)
editableMesh:AddTriangle(v6,v3,v2)

editableMesh:AddTriangle(v3,v4,v1)
editableMesh:AddTriangle(v6,v4,v3)

editableMesh:AddTriangle(v4,v5,v1)
editableMesh:AddTriangle(v6,v5,v4)

editableMesh:AddTriangle(v5,v2,v1)
editableMesh:AddTriangle(v6,v2,v5)

local meshContent = Content.fromObject(editableMesh)
local mesh = AssetService:CreateMeshPartAsync(meshContent, nil)

mesh.Parent = workspace
mesh.Anchored=true
mesh.Position=Vector3.new(0,0,0)
1 Like

It’s possible you’re creating triangles or verts out of order, flipping the normals.

3 Likes

What kind of order? Roblox didn’t told anything about it.

They are not flipped. Whole mesh dissappear when some part of it is over the top of the frameview .

1 Like

It’s because the vertex coordinates are out of -1 to 1 range. If you want the mesh to be big, just change the MeshPart size.
It happens due to Frustum Culling which checks if the object’s bounding box is outside the camera. If it is, it doesn’t render the object, but because in your example the mesh is bigger than the object it doesn’t render the object even tho it’s mesh is outside the bounding box

1 Like

Try settling it to be double sided

1 Like

Size of mesh is set automatically.

It’s not like that. Mesh completly dissapear from the screen. Even if camera is outside of it.

Pretty sure this is mentioned to be an issue and their going to fix it

ok so I found temporary solution

local AssetService = game:GetService("AssetService")
local editableMesh = AssetService:CreateEditableMesh()

local p=workspace:WaitForChild('Part')
local vzero=Vector3.new(0,0,0)

local v1 = editableMesh:AddVertex(vzero)
...

editableMesh:AddTriangle(v1,v2,v3)
...
local meshContent = Content.fromObject(editableMesh)
local mesh = AssetService:CreateMeshPartAsync(meshContent, nil)

editableMesh:SetPosition(v1,Vector3.new(5435,34534,2313) -- setting values here make it visible
...

mesh.Size=Vector3.new(1,1,1)

mesh.Parent = workspace
mesh.Anchored=true
mesh.Position=p.Position

Unfortunately collisions will not work.

By the way do you have an issue when creatinh mesh in the server script it is not visible on the client?