so i have this code where I'm trying to rotate a model and then move it. The problem is after i rotate the model and making it move it immediately returns to its original rotation. (Video of what i mean https://youtu.be/KZy_0Cjn9sg) Can you help me? Here is the code:

workspace.Cessna172.PrimaryPart = workspace.Cessna172.MainPart
local Cessna172 = workspace.Cessna172.MainPartRotate
	for i = 0,650 do
		wait()
		workspace.Cessna172:SetPrimaryPartCFrame(CFrame.new(workspace.Cessna172.PrimaryPart.Position + Vector3.new (-1,0,0)))
end
for j = 1, 10 do
workspace.Cessna172:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame()*CFrame.fromEulerAnglesXYZ(0,-0.01,0))
wait()
end
for i = 0,150 do
		wait()
		workspace.Cessna172:SetPrimaryPartCFrame(CFrame.new(workspace.Cessna172.PrimaryPart.Position + Vector3.new (-1,0,-0.1)))
end
for j = 1, 50 do
workspace.Cessna172:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame()*CFrame.fromEulerAnglesXYZ(0,-0.01,0))
wait()
end
for i = 0,150 do
		wait()
		workspace.Cessna172:SetPrimaryPartCFrame(CFrame.new(workspace.Cessna172.PrimaryPart.Position + Vector3.new (-1,0,-0.1)))
end

3 comments

0

you know you can just tween it right?

0

just do a tween and add a goal rotation to

0

ok thanks!