I can wait for a tween to finish simply by using TweenBase.Completed:Wait(), but what if I wanted to stop this tween (in the middle of it) when another value becomes false?
while true do
wait()
if TweenBool.Value == false then
Frame.Position = UDim2.new(0.338, 0, 0.054, 0)
else
local tweenPosInfo
local tweenPosGoal = {}
if goDown then
tweenPosInfo = TweenInfo.new(0.6, Enum.EasingStyle.Quart, Enum.EasingDirection.Out)
tweenPosGoal.Position = UDim2.new(0.335, 0, 0.532, 0)
else
tweenPosInfo = TweenInfo.new(0.6, Enum.EasingStyle.Quart, Enum.EasingDirection.In)
tweenPosGoal.Position = UDim2.new(0.338, 0, 0.054, 0)
end
local tweenPosition = TweenService:Create(Frame, tweenPosInfo, tweenPosGoal)
goDown = not goDown
tweenPosition.Completed:Wait()
end
end
The problem is that I want to check during the tween. I’m not sure if there’s something else I can do like repeat wait() until tweenPosition.Completed or TweenBool.Value == false but Completed is not a boolean.
Sorry but i don’t know how to do that.
But maybe you could try making the script check if the part you are moving is in an exact position, and if it is, then it stops the tween.
If that doesn’t work i don’t know what you could do.