[V2.0.7] Slider Class - Create Sliders With Ease!

I have a question? How would I make it so when the slider button moves, the part which follows the slider moves with it

Hi! Sorry for the late reply, I never got a notification for some reason. Can you elaborate on what you mean?

1 Like

Hello, here to report a bug within your module.

If you happen to have a controller plugged in the functionality for the slider is then overwritten by the controller support logic despite using the mouse to adjust the slider.

I have my own implementation to prevent this bug, but I thought I’d let you know for future reference

Hi, thanks for the report. That’s actually intentional, I thought it would be better to ignore mouse input if there’s a controller connected, do you think it’ll be better to enable both at the same time? If yes I’ll be sure to change it.

2 Likes

Hello there! I was working on adding this module to my plugin but I can’t get it to work.
The biggest issue is that there isn’t any bug or error shown in the output, so I have no
what I’ve done wrong.

My Code (There is more code, but that's not related to the slider module)
local toolbar = plugin:CreateToolbar("Hip Height Calculator")
local gui = plugin:CreateDockWidgetPluginGui(
	"Hip Height Calculator",
	DockWidgetPluginGuiInfo.new(
		Enum.InitialDockState.Float,
		false,
		true,
		349,
		379,
		349,
		379
	)
)

local frame = script.Parent.PluginUI.Frame
gui.Title = "Hip Height Calculator"
frame.Parent = gui

local viewport = frame.Viewport
local scaleSlider = frame.ScaleSlider

local Slider = require(script.Slider)
local slider = Slider.new(scaleSlider.Fill)

local function SliderMoved()
	local value = slider:GetValue()
	print(value)
end

slider:SetPluginMouse(plugin)
slider.moved:Connect(SliderMoved)
slider:Enable(gui)
The Folder

image

Hello! Thanks for using the module.


Does the slider even move? If not, can you send a simple file so I can replicate your exact UI? Also make sure to use the latest version if you’re not doing so already.

As I understand it, this slider is smooth. But this smoothness only applies to the interface, which doesn’t look great. Then you need the value to change only when the interface changes, not asynchronously.

Fixed it, I for some reason added an older version. Thank you

What…


Lol, alright. You’re welcome.

1 Like

I seem to be having the same problem as xDanix, where the value that was returned was off if you are moving your mouse to fast.

		HeightSlider = SL.new(Gui.CC.SideBar.BodyFrame.BodyType.HeightSlider.SliderLine.Slider, {
			
			values = {min = 95, max = 120},
			defaultValue = 110,
			canLeaveFrame = false,
			canFullyLeaveFrame = false,
			moveToMouse = true,
			
			
		})
		
		WeightSlider = SL.new(Gui.CC.SideBar.BodyFrame.BodyType.WeightSlider.SliderLine.Slider, {
			
			canLeaveFrame = false,
			canFullyLeaveFrame = false,
			moveToMouse = true,
			values = {min = 80, max = 110},
			defaultValue = 90,

		})
		
		HeightSlider:Enable()
		WeightSlider:Enable()
		
		HeightSlider.moved:Connect(function()

			print(HeightSlider:GetValue())

			CCData.HeightVal = HeightSlider:GetValue() / 100

			--

			UpdateCCDummy()

			--

			CurrentSelectedCamera = JailSet.Handler.Cameras.EndCam

		end)

		WeightSlider.moved:Connect(function()

			print(WeightSlider:GetValue())

			CCData.WeightVal = WeightSlider:GetValue() / 100

			--

			UpdateCCDummy()

			--

			CurrentSelectedCamera = JailSet.Handler.Cameras.EndCam

		end)

Hey, thanks for the report! I’ll look into it.

Hey, I couldn’t replicate the issue, I’ll message you privately with a potential fix that you should try using.

Hello there! I have encountered a problem with your module. It works like a charm, and I really like it, but for some reason, if I move the slider quickly, it changes the value incorrectly. Here’s a video demonstration.

External Media

There are 2 problems:

  1. The Max value is set to 600. However, the highest value I could put using the slider was around 580.
  2. The value is different each time.

Is there a workaround for that issue? Or do I just wait for you to release a fix?
Thanks,
Friday

Nice module, altough when first starting; there’s some arguments that you dont know if are necessary or not as they dont have the question mark next to their type:

GetValue’s usePercentage
SetValue’s isPercentage
AddWaypoint’s isPercentage
AddTracker’s roundFunction and textMakerFunction

but maybe im just nitpicky

Hello everyone, it has been almost 5 days, apologies for that, I was travelling to a different country.


I’ve sent Fursonafied a version and he confirmed that it worked, thankfully.
@fridayqx it’s the same issue you are encountering, thanks for the report. A release will be up in a bit.


@Hzodx I get you, the types used there have some issues, I’ll be fixing them all in the next release, if you find any other type issues, please do report. Thanks!

1 Like

Update V2.0.7

:bug: Bug Fixes :bug:

  • Fix fast movement causing inaccurate results from :GetValue

:closed_book: Type Fixes :closed_book:

  • Change type of arguments where passing nil is allowed.
1 Like