Adding Parts to a Scaled Rig (Humanoid) will cause the parts to be scaled additionally after reparenting

To give context: rigs automatically create a child under every part called OriginalSize which keeps track of the objects original size. Whenever an update gets triggered to the rig, it will fix the objects size by doing Size = OriginalSize.Value * Model.Scale.


However, if an OriginalSize property does not exist (for example, you add a part yourself), when an update triggers, this is what will happen:

  1. OriginalSize is added based on the parts current size
    2. Modify that parts size by doing Size = OriginalSize.Value * Model.Scale
    2, Modify that parts size by doing Size = OriginalSize.Value * Vector3.new(Humanoid.BodyWidthScale, Humanoid.BodyHeightScale, Humanoid.BodyDepthScale)

This is problematic as the object is clearly changing size from its intended size as a developer (unless you knew to manually add an OriginalSize value yourself or Model.Scale is set to 1).


Ideally:

  1. Any newly added part in a rig that creates an OriginalSize child should calculate its value by doing:
    OriginalSize.Value = Part.Size / Model.Scale.
    OriginalSize.Value = Part.Size / Vector3.new(Humanoid.BodyWidthScale, Humanoid.BodyHeightScale, Humanoid.BodyDepthScale)

  2. If no OriginalSize child is present, the part should be left alone


Addendum: It appears it doesn't scale by Model.Scale, it actually uses the following humanoid properties to scale on each axis:

RobloxStudioBeta_PwGRjTDYbF


Here is a repro of the issue that can occur:

3 Likes

Thanks for this report. We will take a look into this. From what you’re saying, would it be correct to say that you can get around this issue by adding an OriginalSize with your part?

Yes, you would need to pre-emptively add an originalsize and then have it be the correct relative size. If your part is size 10, and the rigs scale is size 2, then you need to create and set the originalsize value to 5.

1 Like