They might be asking about how they would go about tweening a tween on the same thing which is not possible due to the fact that TweenService will respect the tween until it is done before playing another
Tweens run in their own thread of execution, so playing one tween will not delay the playing of another (unless you attempt to tween the same properties of a single instance in two or more tweens).
ues i mean like that because if you do it with mouse enter and mouse leave the second tween start by stopping the other one but i don’t know how to do it with mousebutton1click
local img = script.Parent.Parent.Frame
local ts = game:GetService("TweenService")
local TI = TweenInfo.new(.2,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut,0,false,-1)
local Tween = ts:Create(img, TI, {Position = UDim2.new(0.5, 0,-1, 0)})
local Tween1 = ts:Create(img, TI, {Position = UDim2.new(0.5, 0,0.5, 0)})
local tr = true
script.Parent.MouseButton1Click:Connect(function()
if tr then
Tween1:Play()
tr = false
else if not tr then
Tween:Play()
tr= true
end
end
end)
local button = script.Parent
local img = button.Parent.Frame
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(.2,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut,0,false,-1)
local tween = nil
local goal = nil
local toggle = false
button.MouseButton1Click:Connect(function()
if tween then
tween:Cancel()
tween = nil
end
goal = if toggle then {Position = UDim2.fromScale(0.5, -1)} else {Position = UDim2.fromScale(0.5, 0.5)}
tween = tweenService:Create(img, tweenInfo, goal)
tween:Play()
end)
You may want to use In or Out for the EasingDirection.
If the topic is solved, you should mark a solution so others know what the solution was. I’m not quite clear on who solved this but mark who helped you so others know. Thanks