Problem 1:
I’m doing A animation for my buttons when I hover over them with my mouse,
but each time the Tween finishes it will reset the Offset and repeat it, but I want after the tween is finished the offset to stay until I leave the button with my mouse.
Problem 2:
When I leave the button with my mouse while the tween is increasing the offset, and I enter the area with my mouse again, it will reset the time until the required offset is reached, but I want when I enter the button again to just proceed rather than having to wait another 3 seconds.
Example: After 90 seconds (When the Gradient Offset would be 0.5) And I leave & reenter the button it should proceed with the remaining 90 seconds rather than the whole 3 minutes
local TI =TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 1, false, 0)
for i,v in pairs(ButtonGradient) do
local mouseIn
PlayButton.MouseEnter:Connect(function()
mouseIn = true
while mouseIn==true do
local Rween =TweenService:create(v, TI, {Offset = Vector2.new(1,0)})
Rween:Play()
Rween.Completed:Wait()
end
end)
PlayButton.MouseLeave:Connect(function()
mouseIn = false
while mouseIn==false do
local Rween =TweenService:create(v, TI, {Offset = Vector2.new(0,0)})
Rween:Play()
Rween.Completed:Wait()
end
end)
end```