The script works, thing is, when you steer left, then go all the way right (Vise versa), as the plane gets to the straight position it rotates on the parts Y axis causing the nose to go up (Which isnt in the script .-.). Anyone got an idea or solution?
local maxBank = 90 local gyro = game.Players.LocalPlayer.Character.Real.Main.Gyro local bank = ((((m.ViewSizeX/2)-m.X)/(m.ViewSizeX/2))*maxBank) --Some value here prolly? bank = (bank < -maxBank and -maxBank or bank > maxBank and maxBank or bank) gyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge) gyro.cframe = (m.Hit*CFrame.Angles(0,0,math.rad(bank)))
OK! Your problem is that you need to rotate based on the lookVector of the plane, so that it rotates based on the direction of the plane AND the banking -- set the bodyGyro CFrame to this:
local gyro = game.Players.LocalPlayer.Character.Real.Main.Gyro bank = (bank < -maxBank and -maxBank or bank > maxBank and maxBank or bank) gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) gyro.cframe = m.Hit*CFrame.new(gyro.Parent.CFrame.lookVector) * CFrame.Angles(0, 0, math.rad(bank))