All I need is a simple bar which uses Tweening. I have a localscript inside of ‘Background’. There is a bar inside of it called ‘BarMover’. This is what will move. This bar will move if the mouse is being held down. When it is not being held anymore (released) the bar stops moving/tweening.
(This is for a football/soccer game and this shows the amount of shooting power.)
I can give more info if needed, but all I need is someone to tell me how to do this and maybe write a little script which I can edit so that it works for this bar. (gui)
it’s far more complicated, you have to limit bar movement onto One Axis and find the mouse position reelative to the bar position, then move it to the position, i’m did this on the 3D but 2D this can be tricky , use UDIM2 to move this slider or bar
You have to get position of the mouse, and then position of the frame, try to move frame to mouse position first ,it makes the frame strange move to the mouse vvith random offset, then try to test and research on that, you have to divide some position to get it relative, and then move it
you have to make an area and define it, then check if relative position is outside or inside the area, if yes you moves it to this position, else do something else
you can just use something like tick() for this purpose to get the times something happened, where you can then calculate the amount of power to apply based on that.
local Percentage = math.clamp((MousePos.X-Slider.AbsolutePosition.X)/Slider.AbsoluteSize.X,0,1)
SliderCircle.Position = UDim2.new(Percentage,0,BtnPos.Y.Scale,BtnPos.Y.Offset) -- This is the button (BtnPos is the current Button position before changing)
No. A bar on the bottom of the screen which shows how much power your shot has. For example, max is 200, minimum is 30. When it is halfway, so is the bar. This will use tweening