How would I convert a MeshPart to a Special Mesh? I have split MeshParts that must be positioned EXACTLY where they are in the beginning. I tried the following script and they won't keep their position:

for i, v in next, workspace.MyMesh:GetChildren() do
	if v:IsA("Model") then
		local c = v:FindFirstChild("1")
		if c:IsA("MeshPart") then
			local p = Instance.new("Part", c.Parent)
			local m = Instance.new("SpecialMesh", p)
			p.Name = c.Name
			p.Position = c.Position
			p.CFrame = c.CFrame
			p.Size = c.Size
			m.MeshType = Enum.MeshType.FileMesh
			m.TextureId = c.TextureID
			m.MeshId = c.MeshId
			for o, pa in next, v:GetChildren() do
				if pa:IsA('MeshPart') then pa:Destroy() end
			end
		end
	end
end

4 comments

0

MeshId cannot be assigned to from scripts. Also, don't use the parent argument. It is deprecated and is known to cause latency.

0

You can assign a SpecialMesh's MeshId. That's why I am using it.

0

No you can't.

0

Yes you can. Go check.