I have a function I’ve used for years for handling mouse-based movement for things like planes. It works decently, well, but I’ve noticed that the movement is too fluid/maneuverable, as seen below:
Here is the code for this.
local run = game:GetService("RunService")
local Mouse = player:GetMouse()
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
run.RenderStepped:Connect(function(deltaTime: number)
Mouse.TargetFilter = game.Workspace
local BankAngle = GetBankAngle(Mouse)
engine.AlignOrientation.CFrame = (Mouse.Hit*CFrame.Angles(0,0,BankAngle))
end)
I’ve tried playing around with the numbers inside the GetBankAngle function, but nothing changes. How can I easily edit this?