How do I use TweenService to get this MeshPart to Rotate + Move?

I’m working on a Tweening script for some landing gear for some planes I am working on. I am looking to have the script rotate the plane’s landing gear by 90 degrees, and then move it by studs in the Y direction.

Here’s my script:

local angle = CFrame.Angles(0,math.rad(45),0)
local goal = {}
local tweenInfo = TweenInfo.new(5)
local TweenService = game:GetService("TweenService")
goal.Orientation = Vector3.new(0,0,-90)
goal.CFrame = CFrame.new(script.Parent.Position) + Vector3.new(0,-3,0)

local tween = TweenService:Create(script.Parent, tweenInfo, goal)

tween:Play()

However, it only rotates the part, it doesn’t move it, as seen here:
https://gyazo.com/92910dd8b5d1a0d01b86cffc7eacac2b

How do I fix this?

Orientation is shadowing CFrame. You have to apply the rotation to the CFrame itself for both of them to occur
Something like this:

local goal = {}
local rot = CFrame.fromOrientation(0, 0, math.rad(-90))
local pos = script.Parent.Position + Vector3.new(0, -3, 0)
goal.CFrame = CFrame.new(pos) * rot

Still not moving, at all.
https://gyazo.com/0957a23cd9aabb2503420f900da508cc

maybe try Position instead of CFrame


goal.Position = script.Parent.Position + Vector3.new(0,-3,0)


or you could even use the build in position and rotation that CFrame has instead of using Orientation and CFrame because its being skipped

I did that, but the issue became this: https://gyazo.com/db7b296efa0473aa0f61d2870791c487
The positioning of the landing gear got wonky as the plane moved, which is going to happen as players fly these things.

Just having it do orientation was not an issue, though: https://gyazo.com/e8b6648b0cd6c063abd7aa29982a431c

The orientation did become an issue, however, when I started rotating the plane a lot, which, again, will happen as players fly these things.

https://gyazo.com/57fa59ec75df17374d0188cca748797f

Might aswell not tween it. Try using AlignPosition and AlignOrientation

local goal = {Orientation = Vector3.new(0,0,-90), Position = script.Parent.Position + Vector3.new(0,-3,0)}

-- to add a position locally (with CFrames) do: Vector3.new(script.Parent.CFrame * CFrame.new(0,-3,0))

2 things, you can’t add a vector3 to a CFrame, and try to to not manipulate a parts position/orientation and its CFrame at the same time as CFrame describes both position and rotation already (i dont know what happened if you did but you could imagine the confusion)

the easiest fix for this is to animate the landing gear with moon animator(if you have it) or tween the C0/C1 property of a motor6d/WeldConstraint that connects the landing gear to the hinge on the airplane