The character is rigged up so it works with R15 avatar animations without a problem. The good thing about R15 is that all I need to do to rescale the character is by changing the values inside the humanoid (BodyDepthScale, BodyWidthScale, HeadScale, etc.). I just scaled these factors, but this was what happened when I called it to be small (0.5x) and big (2x)
You can iterate through the motor joints in your character and adjust their offsets by some scale percentage.
local motors = {} --add all the character's motor6Ds to this
local scalePercent = 0.5
for _, motor in pairs(motors) do
motor.C0 = CFrame.new((motor.C0.Position * scalePercent)) * (motor.C0 - motor.C0.Position)
motor.C1 = CFrame.new((motor.C1.Position * scalePercent)) * (motor.C1 - motor.C1.Position)
end
When I change the size it works. However, when I change the scale again then it goes back to breaking again. This is especially after i select the biggest scale. Then smaller scale becomes broken again
You can store the original scale in a variable, like so:
local motors = {} --add all the character's motor6Ds to this
local offset = {}
for i, motor in pairs(motors) do
offset[i] = {motor.C0, motor.C1}
end
local function scale(scalePercent)
for i, motor in pairs(motors) do
local baseC0, baseC1 = unpack(offset[i])
motor.C0 = CFrame.new((baseC0.Position * scalePercent)) * (baseC0 - baseC0.Position)
motor.C1 = CFrame.new((baseC1.Position * scalePercent)) * (baseC1 - baseC1.Position)
end
end