Dragging UI on Single Axis

Hey there,

I wanted to try making a draggable UI for a volume setting as a test and, i realised that i don’t know how to move a UI on only one axis, by this i mean only moving the axis one way, so in my example it would be horizontally and not vertically.

(An example could be on Roblox Islands)

I have found some modules about this but they have no support for single axis i am pretty sure.

If anyone else can help me i would appreciate that very much.

Thanks for reading,

Kieran :slight_smile:

1 Like

I believe the best way to do this is by using a ScrollingFrame. Simply change the X-axis size of the CanvasSize property in order to get a horizontal bar (the bigger the CanvasSize the shorter the scrollbar will be). You can play with its properties to make it work and look exactly how you want without involving a script to manage the movement. You’ll only need a script to connect the position of the scrollbar to the volume setting somehow.

1 Like