Help with rotating a plane with CFrames

I want to rotate the plane to the sides like this but using cframes (the video is using orientation and causing some trouble with the welds, so i need a cframe way to do this)

Currenly Im using CFrames but it rotates to the sides like this and sometimes will just make the plane flipped

				if d_pressed then
					currentseat.Parent.PlaneMesh.CFrame *= CFrame.Angles(0, math.rad(-45/50), 0)
					--currentseat.Parent.PlaneMesh.Orientation += Vector3.new(0, -1.5, 0)
				end
				if a_pressed then
					currentseat.Parent.PlaneMesh.CFrame *= CFrame.Angles(0, math.rad(45/50), 0)
					--currentseat.Parent.PlaneMesh.Orientation += Vector3.new(0, 1.5, 0)
				end

I would appreciate the help thanks.

1 Like

It looks like you’re only rotating the plane, but not the seat?

It looks like it’s a ‘gimbal lock’ issue.
When you CFrame something by 90 degrees you align 2 of the axes and they cause an unwanted rotation and input errors like pressing A or D with the keyboard makes the plane go nose up or down.

There are plenty of other posts about this topic, use the Search tool with the term ‘gimbal lock’.

2 Likes