-
What do you want to achieve?
I want the Tween to cancel when the function is called. -
What is the issue? Include screenshots / videos if possible!
The function is being called and it works perfectly. However, Tween:Cancel() is not working.
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(.25, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local Goal = {}
Goal.CFrame = CFrame.new(SCP.Position, Position)
local Tween = TweenService:Create(SCP, Info, Goal)
Tween:Play()
local Info2 = TweenInfo.new(4, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, .25)
local Goal2 = {}
Goal2.Position = Position
local Tween2 = TweenService:Create(SCP, Info2, Goal2)
Tween2:Play()
SCP.Moving:Play()
Events.BeingLooked.OnServerEvent:Connect(function(Player, IsLooking)
if IsLooking then
Tween:Cancel()
Tween2:Cancel()
SCP.Moving:Stop()
end
end)
“Tween2” is canceled, however “Tween” does not get canceled. Thanks for any help.