I have been trying to tween a gui so it goes in the screen for a few seconds then goes out again.
the thing is, my tween simply doesn’t work… It just teleports the gui where it is supposed to go and doesn’t tween it.
local goal = {}
goal.Position = UDim2.new(0.5, 0, 0, 0)
local tweenInfo = TweenInfo.new(1, -- the time it takes for the tween
Enum.EasingDirection.In,
Enum.EasingStyle.Exponential,
)
local tween = TweenService:Create(part, tweenInfo, goal)
is better in my opinion.
The problem is that the two tweens are conflicting, use the method above with
-- the "tween" var is the tween's variable
tween.Completed:Wait()
in between
Ex:
local CurrentRegion = script.Parent.CurrentRegion
local Text = script.Parent.PlaceName
CurrentRegion.Changed:Connect(function()
Text.Visible = true
Text.Text = CurrentRegion.Value
local goal = {}
goal.Position = UDim2.new(0.5, 0, .2, 0)
local tweenInfo = TweenInfo.new(1,
Enum.EasingDirection.Out,
Enum.EasingStyle.Exponential,
)
local tween = TweenService:Create(Text, tweenInfo, goal)
tween.Completed:Wait()
goal.Position = UDim2.new(0.5, 0, 0, 0)
local tweenInfo = TweenInfo.new(1,
Enum.EasingDirection.In,
Enum.EasingStyle.Exponential,
)
local tween = TweenService:Create(Text, tweenInfo, goal)
Text.Visible = false
end)