I have a script that is meant to create an editable emesh from a roblo asset
the script is:
local mesh = game:GetService("AssetService"):CreateEditableMeshAsync("rbxassetid://116838440116919")
mesh.Parent = game.Workspace
local pointVerts = {} -- to merge close verts, :MergeVerticies didnt work.
for i,v in pairs(mesh:GetVertices()) do
local id = 0
for wstidb,d in pairs(pointVerts) do
for _,p in pairs(d) do
if (mesh:GetPosition(p)-mesh:GetPosition(v)).Magnitude < 0.2 then
id = wstidb
end
end
end
if id > 0 then
pointVerts[id][#pointVerts[id]+1] = v
else
pointVerts[#pointVerts+1] = {v}
end
end
print(pointVerts)
this should work as i am not even editing the mesh but the editable mesh is in workspace but isnt visible, the script is also a localscript, is there something i am doing wrong?