so i have this morph, and once i use it i cant rotate anymore until i remove the “leftshoulder” part for some reason. when deleting left shoulder without deleting the right shoulder it also makes me stuck and unable to move, as if anchored, the same is not true about viceversa. i am not sure what causes this…heres the morph code (yes i know alot of the code says weld and not motor6d, that is due to it being edited from the weld script i usually use to now use motor6d.)
local CloneAndWeldModule = {}
-- Function to clone and weld a model by name (morph name)
function CloneAndWeldModule.cloneAndWeld(character, morphName)
-- Clone the model from ServerStorage
local modelClone = game.ServerStorage.CharacterModel:FindFirstChild(morphName):Clone()
if not modelClone then
warn("Morph model '" .. morphName .. "' not found in ServerStorage!")
return
end
modelClone.Parent = character
character.Parent = game.Workspace.Players
-- Predefined part details for the morphs
local partDetails = {
{bodyPartName = "Chest", middlePartName = "Middle3", attachPartName = "Torso"},
{bodyPartName = "Headz", middlePartName = "Middle4", attachPartName = "Head"},
{bodyPartName = "Arm1", middlePartName = "Middle1", attachPartName = "Left Arm"},
{bodyPartName = "Arm2", middlePartName = "Middle2", attachPartName = "Right Arm"},
{bodyPartName = "Leg1", middlePartName = "Middle5", attachPartName = "Left Leg"},
{bodyPartName = "Leg2", middlePartName = "Middle6", attachPartName = "Right Leg"}
}
-- Iterate over part details and weld them
for _, partDetail in ipairs(partDetails) do
local bodyPart = modelClone:FindFirstChild(partDetail.bodyPartName)
if not bodyPart then
warn(partDetail.bodyPartName .. " not found in the model!")
return
end
local middlePart = bodyPart:FindFirstChild(partDetail.middlePartName)
if not middlePart then
warn(partDetail.middlePartName .. " not found in " .. partDetail.bodyPartName)
return
end
-- Weld the middle part to the specified character part
local attachPart = character:FindFirstChild(partDetail.attachPartName)
if attachPart then
local weldToBody = Instance.new("Motor6D")
weldToBody.Part0 = attachPart
weldToBody.Part1 = middlePart
weldToBody.C0 = CFrame.new(0, 0, 0)
weldToBody.Parent = attachPart
end
-- Configure parts (Anchored = false, CanCollide = false)
for _, child in ipairs(bodyPart:GetChildren()) do
if child:IsA("BasePart") then
child.Anchored = false
child.CanCollide = false
end
end
end
end
return CloneAndWeldModule