Need help with tweening - ui "bounces"

Hello!

I’m trying to add an effect to a loading screen by “sliding” a background downwards. I kind of got it, but the only problem is that the paws in the background bounce back and forth.

https://gyazo.com/01a986869ad7c34b5e7d6713a749e7b0?token=ffb3e798ecb9049f0afed63ec62c4647

Code:

while true do
	script.Parent:TweenPosition(UDim2.new(-0.027,0,-0.052,0),"Out","Linear",1,true)
	wait(1)
	script.Parent.Position = UDim2.new(-0.1, 0, -0.25, 0)
end

Any help is appreciated. Thank you! :slight_smile:

1 Like

Are you moving the frame containing the paws or moving them separately? Make sure the UDim2’s are right. Maybe use the tweenservice and tween.Ended:Wait() instead of the wait(1).

Hi Rezault!

I was searching something sort of related to this topic, and wanted to help answer if you haven’t already found an answer to this. Also, since it’s the top result for this search, I figured I would supply the best answer :slight_smile:

local tweenService = game:GetService("TweenService")

local tween = tweenService:Create(script.Parent, TweenInfo.new(10, Enum.EasingStyle.Linear), {Position = UDim2.new(0, 0, -1)})

while true do

script.Parent.Position = UDim2.new(-1)

tween:Play()

tween.Completed:Wait()

end
1 Like

Bro Udim2 value takes 4 parameters…

Works for me regardless, but you can add the zeros and commas if you want.

1 Like