Model rotates in Tween Service

Hi! so I was making a rocket that must fly upwards, but it starts rotating when tween is playing.
Here’s a video:

And here’s the script:

local rocket = script.Parent.Parent
	
local cfv = Instance.new("CFrameValue")
cfv.Value = rocket:GetPivot()
cfv.Parent = script
	
local tween = TS:Create(cfv, TweenInfo.new(60, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, -1, false), {Value = CFrame.new(rocket:GetPivot().Position + Vector3.new(0, 3000, 0))})
tween:Play()
	
cfv.Changed:Connect(function(val)
	rocket:PivotTo(val)
end)

because youre creating a new cframe without the rotation angles
try this

local tween = TS:Create(cfv, TweenInfo.new(60, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, -1, false), {Value = rocket:GetPivot() + Vector3.new(0, 3000, 0)})
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.