How to make a loading bar that goes back and forth

hey guys, I don’t know what topic this would be but i can’t find it for tweening.
Theres this game were it has this loadingbar that interests me.

It uses tweenservice i think where the insidebar goes back and forth till the game loads and i wanna know how to replicate it.

Heres the video

10 Likes

Hey I think you should search on Google before creating a topic:
Found TweenService | Documentation, on the official website.

1 Like
  1. I know how to do tweens
  2. i tried to replicate it and it didnt work
2 Likes

Could I see your code? vhscddvd

I already discarded the draft, it went something like bar:tweenposition

2 Likes

Just tween a GuiObjects position and set the tween to repeat -1 times (thats inf for tweenservice) and set it to reverse. Ez :))

1 Like
UIBar = whereitis
TweenService = game:GetService("TweenService")

Tween = TweenService:Create(UIBar, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, true, 0.5), {Position = UDim2.new(0, 0, 0, 30)}))
Tween:Play()

Would that work?

1 Like

well, it didn’t work lol + its tween:play() if you do :play() at the end it would redline

1 Like

Position uses Udim2, not Vector2

Udim2 Arguments

Udim2.new(ScaleX,OffsetX,ScaleY,OffsetY)

1 Like

Ill try to do that then lol hhhhh

1 Like

Sorry, got confused. I edited the original post.

1 Like

It was tween:play() and udim2.new, i did that with your script it works but it just moves it up right then down left lol so ill edit position and get back with you

2 Likes
``UIBar = script.Parent.Parent.Frame
TweenService = game:GetService("TweenService")


Tween = TweenService:Create(UIBar, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, true, 0.5), {Position = UDim2.new(0.911, 0,0.402, 0)})
Tween:Play()`

Thanks, worked

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.