I’ve got a “Yaw” variable, and when it is set to 0, I want the X rotation of my body gyro’s CFrame to also return to 0, whilst keeping the course that it was going originally. What I’m trying to do is make a plane so that when the player is done turning, the X rotation will smoothly transition back to being level again.
I’ve tried using CFrame.Angles(), and CFrame.fromEulerAngles() but nothing works to bring it back to 0 in a smooth rotation.
if yaw == 0 then
--Set the X rotation of the bodyGyro to 0 (smoothly, not just a snap)
script.Parent.BodyGyro.CFrame = script.Parent.CFrame * CFrame.Angles(0, 0, 0) * CFrame.fromEulerAngles(0, yaw * yawMultiplier, pitch * pitchMultiplier)
else
script.Parent.BodyGyro.CFrame = script.Parent.CFrame * CFrame.fromEulerAngles(yaw * -rollMultiplier, yaw * yawMultiplier, pitch * pitchMultiplier)
end