Some reason on the turn part, it turns and goes backwards. Help?
local tw = game:GetService("TweenService")
local part = script.Parent.Union
local goalForward = {}
goalForward.CFrame = part.CFrame * CFrame.new(0, 0, -120)
local goalTurn = {}
goalTurn.CFrame = part.CFrame * CFrame.Angles(0, math.rad(180), 0)
local goalBackward = {}
goalBackward.CFrame = part.CFrame * CFrame.new(0, 0, 0)
local tweenInfo = TweenInfo.new(1)
local tweenForward = tw:Create(part, TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0), goalForward)
local tweenTurn = tw:Create(part, TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0), goalTurn)
local tweenBackward = tw:Create(part, TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0), goalBackward)
wait(10)
tweenForward:Play()
wait(5)
tweenTurn:Play()
wait(30)
tweenBackward:Play()
PapaBreadd
(PapaBreadd)
October 10, 2021, 12:11am
2
Youd have to rotate the final cframe by how much it should be rotated
local goalBackward = {}
goalBackward.CFrame = part.CFrame * CFrame.Angles(0, math.rad(180), 0)
Not supposed to? It’s supposed to go forward, turn, then back, but it turns and goes back at the same time, then turns at the end some reason? Don’t know why.
and skips this wait.
PapaBreadd
(PapaBreadd)
October 10, 2021, 12:22am
4
Oh I forgot another problem
local goalForward = {}
goalForward.CFrame = part.CFrame * CFrame.new(0, 0, -120)
local goalTurn = {}
goalTurn.CFrame = part.CFrame * CFrame.new(0, 0, -120) * CFrame.Angles(0, math.rad(180), 0)
local goalBackward = {}
goalBackward.CFrame = part.CFrame * CFrame.Angles(0, math.rad(180), 0)
The changes dont add onto themselves, you have to add them all together yourself
It’s not supposed to turn at the end.
And some reason it still turns at the end.
Maybe the timing is wrong for each Tween.
I suggest you use the Tween.Finished event, which yields the script until the tween finishes, it’s useful if you wanna play a tween after a tween is done playing.