I believe this is happening because there are no RigAttachments to re-position the body parts as it is a Skinned/Bone rig… Is there any way to make those Bones re-position…?
I was able to scale the whole model in a live game using Robloxes Scaling tool in Studio… I wish there was a way to replicate that because it works so smoothly. I tried a Model Scaling script but it breaks all the Motor6Ds and Welds.
In conclusion, I have noticed the model is in fact getting larger but the bones are not scaling with it. That is why the model is getting squashed as it is trying to keep the original bone positions but the model is getting larger.
Yes, that’s the problem, is there some way to maybe scale bone positions? The scale tool somehow scales everything in a model, so there must be some way to do it.
I figure this is better late than never as it seems still relevant… and hopefully someone else may find this useful. I corrected the parameter name, commented out part of the rotation line, and created the missing scaleVector from the scaleFactor. That got it to work for my use-case:
function scaleRecursive(meshPart, instance, scaleFactor)
if instance:isA("Bone") then
local scaleVector3 = Vector3.new(scaleFactor, scaleFactor, scaleFactor)
-- move bone local translation to part space, scale xyz in part space, then move back to bone parent space
local bone = instance
local parentCFrame
if (bone.Parent:IsA("Bone")) then -- parent can be either the MeshPart or another Bone
parentCFrame = bone.Parent.WorldCFrame
else
parentCFrame = bone.Parent.CFrame
end
local parentInPartCFrame = meshPart.CFrame:Inverse() * parentCFrame
local parentInPartRotationCFrame = parentInPartCFrame --[[-> parentInPartCFrame.Position --rotation only --]]
local pivotOffsetInPartSpace = parentInPartRotationCFrame * bone.Position
local scaledPivotOffsetInPartSpace = pivotOffsetInPartSpace * scaleVector3
local partToParentRotationCFrame = parentInPartRotationCFrame:inverse()
bone.Position = partToParentRotationCFrame * scaledPivotOffsetInPartSpace
end
local children = instance:GetChildren()
for i = 1, #children do
local child = children[i]
scaleRecursive(meshPart, child, scaleFactor)
end
end
print("Scaling Part and Bone hierarchy ...")
local scaleFactor = .67 -- edit this to your scale factor
local part = workspace.NEWTowel.Towel -- edit this to point to the MeshPart you are scaling
scaleRecursive(part, part, scaleFactor)
part.Size = Vector3.new(part.Size.x * scaleFactor, part.Size.y * scaleFactor, part.Size.z * scaleFactor)
print("Done.")