I’m trying to convert all the player’s accessories and head into meshparts instead of special meshes, and since I’m using R6 I cant use the property of workspace which automatically does this. So I read that you can create MeshParts using InsertService:CreateMeshPartAsync(), but I’m getting a strange error when I try using it.
Here’s my code:
for i, v in pairs(Character:GetDescendants()) do
if v:IsA("Accessory") then
local is = game:GetService("InsertService")
local mesh = is:CreateMeshPartAsync(v.Handle.SpecialMesh.MeshId)
local accessory = Instance.new("Accessory")
accessory.Parent = character
mesh.Parent = accessory
accessory.Name = v.Name
v:Destroy()
end
end
So quick update, I’ve tried InsertService:LoadAsset(), which can be used on the server. The issue is that I need to actually own the assets to insert them. Meaning that it is literally impossible to convert SpecialMeshes into MeshParts via a script. If anyone has some workaround, please let me know, as I need MeshParts for my problem to be solved and I cannot seem to find any other way.
InsertService:CreateMeshPartAsync() is tagged as “PLUGIN SECURITY”. Therefore, attempting to use the method in an in-game script is impossible. Which is why you get: The current thread (script) cannot call 'CreateMeshPartAsync' (lacking capability plugin)
A simple but terrible alternative could be BasePart:UnionAsync() or GeometryService:UnionAsync(), which simply unions the BaseParts provided. However, this can cause lag if you use too many complicated unions.