Please, tell me, am I working with EditableMesh incorrectly or is there a problem?
When I add WrapDeformer, the skinned rig body immediately breaks.
What I want: to change the skinned rig body, smoothly turning it into the body of another skinned rig, while the body parts are in their places and do not break, and also so that the clothes continue to look correct.
So far there are problems even at the initial stage (simple addition of WrapDeformer). Then, when the EditableMesh transformation occurs, the problems get worse (body parts either fall into other body parts, or, conversely, separate)
Well, the second problem is EditableMesh permissions - it is not clear how to work in a team.
Script
local AssetService = game:GetService("AssetService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local character = Players.LocalPlayer.Character or Players.LocalPlayer.CharacterAdded:Wait()
local partsToMorph = {
"UpperTorso", "LowerTorso", "RightUpperArm", "RightLowerArm", "RightHand",
"LeftUpperArm", "LeftLowerArm", "LeftHand", "Head", "RightUpperLeg",
"RightLowerLeg", "RightFoot", "LeftUpperLeg", "LeftLowerLeg", "LeftFoot",
}
local function createWrapDeformer(part)
local wrapDeformer = part:FindFirstChildWhichIsA("WrapDeformer")
if not wrapDeformer then
wrapDeformer = Instance.new("WrapDeformer")
wrapDeformer.Parent = part
end
return wrapDeformer
end
local function loadMeshesAsync()
local totalTasks = 0
local completedTasks = 0
local completed = false
for _, partName in pairs(partsToMorph) do
totalTasks += 1
task.spawn(function()
local bodyPart = character:WaitForChild(partName)
local wrapTarget = bodyPart:FindFirstChildWhichIsA("WrapTarget")
if wrapTarget then
createWrapDeformer(bodyPart)
local originMesh = AssetService:CreateEditableMeshAsync(wrapTarget.CageMeshContent)
bodyPart.WrapDeformer:SetCageMeshContent(Content.fromObject(originMesh))
end
completedTasks += 1
if completedTasks == totalTasks then
completed = true
end
end)
end
while not completed do
task.wait()
end
end
loadMeshesAsync()