Problems with rescaling custom Character

I’m working on a game, and I added a GUI that lets you rescale your character. The starter character is a robot with a custom bottom.


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)

Normally the joints should fix themselves and also if you’re wondering AutomaticScaling is enabled.
Is there a solution to this problem?

1 Like

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

It works until you try to change your size. That’s when things go back to the way it was until you go back to the biggest scale

What do you mean? I dont understand.

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
1 Like

yeah, i realized that was the problem and it fixed it