Hello, I’ve got a Tweenglitch that I’m trying to fix.
Video:
Code:
local TweenService = game:GetService('TweenService')
local Top = script.Parent.Top
local Bottom = script.Parent.Bottom
local tweenInfo = TweenInfo.new(
10, -- slow for demonstration
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
1,
false,
0
)
local TopGoal = {}
TopGoal.Position = Vector3.new(Top.Middle.Position.X, Top.Middle.Position.Y - 15,Top.Middle.Position.Z)
TopGoal.Orientation = Vector3.new(Top.Middle.Orientation.X, Top.Middle.Orientation.Y + 180, Top.Middle.Orientation.Z)
local TopEnd = {}
TopEnd.Position = Vector3.new(Top.Middle.Position.X, Top.Middle.Position.Y,Top.Middle.Position.Z)
TopEnd.Orientation = Vector3.new(Top.Middle.Orientation.X, Top.Middle.Orientation.Y, Top.Middle.Orientation.Z)
local BottomGoal = {}
BottomGoal.Position = Vector3.new(Bottom.Position.X, Top)
local tween = TweenService:Create(Top.Middle, tweenInfo, TopGoal)
local tween2 = TweenService:Create(Top.Middle, tweenInfo, TopEnd)
wait(3)
tween:Play()
tween.Completed:Connect(function()
tween2:Play()
print('Ok Tween 2 Playing')
end)
tween2.Completed:Connect(function()
tween:Play()
p
So what I want it to do is move down the goal position, then play the second tween that reverts it back.to the original position.
The rotation basically performs a 360.
If you want it to reverse turn then you don’t really have to make a whole other tween for it, you can just allow reverse in TweenInfo like @reetism said, also I highly suggest using CFrames.