Scaling Confusion

At 02:56, you set the size of the Slider to 397x12. But isn't this vertically squashing all the children down by 40%? The previous Slider height was 20 and we set it to 12. The Handle and Background are both noticeably affected.

  • You seem to manually undo this for the Handle's height at 03:47.
  • But you still end up having to adjust the overall Y-scale of the whole Slider at 04:54, which also adjusts the Background height.
  • This Y-axis scaling consequently has now overstretched the handle, and you adjust the handle again at 05:08.
  • That Y-axis scaling also makes the AudioText image vertically stretched out. You can compare it to the original Audio image (bottom-right corner) at 06:43. You can also compare to the Return text and see that both Audio and Difficulty are vertically stretched.

To get the slider to be the actual size of 397x12,  I had to:

  • Alt-Shift-Click the center anchor preset on the slider's Background to also manually set the height/width at 397x12.
  • Set the correct Handle width and position. If using the original Knob image, set the Handle width to its original 40px, and then calculate the Top/Bottom offset by (heightOfHandle - heightOfSlider)/2. So (40px - 12px)/2 = 14px. Top and Bottom should each be set to -14. Now you can scale XY to the desired size.
  • Since the Cube image is also square, it actually just swaps out with Knob no problem, since the Handle is set to stretch.
  • For SliderHandle, it is 32px high, so (32px - 12px)/2 = 10px. Set Top/Bottom to -10. Set the width to 38px. Now the image is correctly proportioned. To center it on the slider, you still have to position it manually, since the circle is not in the exact middle of the image.

Does this seem like the right approach?


  • Jonathan Gonzalez(jgonzalez) replied

    With sliders and similar prefab components scaling things and moving them around can be a bit tedious, but yes it sounds like you found a good approach. Everything is usually parented together and as such they inherit the scale/rotation/position of those above them.