Tweening position of GUI is not working properly

I’m just doing a simple tween animation for a gui frame where it just goes up and down. It works just fine going down but when it tries to go back up and off the screen it doesn’t and just teleports to 0,0,0,0 then teleports to its end destination. I have no idea what is the cause of this and especially since it was working just perfectly as of last night. So I might need some help on making the gui just not go to 0,0,0,0.

game.ReplicatedStorage.AchievementsEvent.BlueRockEvent.OnClientEvent:Connect(function() script.Parent:TweenPosition(UDim2.new(0, 0, .12, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Elastic, 1.5, true) wait(1) script.Parent:TweenPosition(UDim2.new(0, 0, -0.3, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Cubic, 0.7, true) end)

and i’m new to posting topics so I don’t know how to do the code box thing.

2 Likes

I really recommend doing this
local service = game:GetService(“TweenService”)
local tween = service:Create(script.Parent,TweenInfo.new(1.5,Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut),{whatever position u want})
tween:Play()
u can detect when it finishes with
tween.Completed:Wait()

This works beautifully thank you for your time.

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