Continuing on,
I have attempted the conversion, and it has not gone well. The plane moves but is now uncontrollable, as seen in this GIF.
I am not really sure what I did wrong.
For the code, all I did was the following:
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local Humanoid = char:WaitForChild("Humanoid")
local val = script:WaitForChild("plane")
local connection = val.Value
local USINS=game:getService("UserInputService")
local engine = connection:WaitForChild("Engine")
local gyro = engine:WaitForChild("AlignOrientation")
local velo = engine:WaitForChild("LinearVelocity")
local clickMove = false
local function GetBankAngle(M) --This function calculates the Bank Angle
local VSX,X = M.ViewSizeX,M.X
local Ratio = (((VSX/2) - X)/(VSX/2))
Ratio = (Ratio < -1 and -1 or Ratio > 1 and 1 or Ratio)
return math.rad(Ratio * 80)
end
local function SetAlignOrientationCFrame(alignOrientation, cframe)
alignOrientation.PrimaryAxis = cframe.RightVector
alignOrientation.SecondaryAxis = cframe.UpVector
end
if connection ~= nil then
game["Run Service"].RenderStepped:Connect(function(step)
if not USINS:GetFocusedTextBox() then
Mouse.TargetFilter = game.Workspace
local BankAngle = GetBankAngle(Mouse)
if clickMove then
SetAlignOrientationCFrame(gyro,((LastHit or Mouse.Hit)*CFrame.Angles(0,0,BankAngle)))
else
SetAlignOrientationCFrame(gyro,(Mouse.Hit*CFrame.Angles(0,0,BankAngle)))
end
velo.VectorVelocity = (engine.CFrame.lookVector)*values.currSpeed.Value
end
end)
end
It appears that LinearVelocity works fine, but that using AlignPosition completely breaks it.
The following media show how I set up the constraints in the plane:
https://gyazo.com/52a9719abe6ab4b7f7984a775c9a3d6b
Close up of the Constraints
Close up of the AlignOrientation