Hi!
I am trying to make a piece of my GUI tween in and out of view. I am having issues with the position despite using scale rather than offset. In studio, the GUI element sits off-screen, but as soon as I test it ingame, you can clearly see that it is on-screen when it’s set as ‘Visible’ and it tweens further down than it should. The position in the properties screen while watching the tween, however, is correct.
All help would be very appreciated
How my UI looks in studio (and how it should look ingame) at the before & after positions set in the tween:
Before:
After:
Properties of the frame:
The tween script (In particular, line 65, 67, and 78):
local TInfo = TweenInfo.new(2, Enum.EasingStyle.Linear)
local MInfo = TweenInfo.new(3, Enum.EasingStyle.Cubic)
local MainTween = TweenService:Create(LvlUp, MInfo, { Position = UDim2.new(0.432, 0, 0.01, 0)})
MainTween:Play()
MainTween.Completed:Wait()
local Tween = TweenService:Create(LvlUp.Level, TInfo, { Transparency = 0.3 })
local TextTween = TweenService:Create(LvlUp.Level.TextLabel, TInfo, { TextTransparency = 0 })
Tween:Play()
TextTween:Play()
Tween.Completed:Connect(function()
task.wait(3)
local MainTween = TweenService:Create(LvlUp, MInfo, { Position = UDim2.new(0.432, 0, -0.2, 0)})
local Tween = TweenService:Create(LvlUp.Level, TInfo, { Transparency = 1 })
local TextTween = TweenService:Create(LvlUp.Level.TextLabel, TInfo, { TextTransparency = 1 })
MainTween:Play()
Tween:Play()
TextTween:Play()
MainTween.Completed:Wait()
LvlUp:Destroy()
end)
How the GUI works in real-play: