So I am trying to make a plane with realistic plane physics and for some reason when my plane is not moving for too long the plane will just break and refuse to move (See glitched results) but if I start moving the plane early enough I am able to get it to move (see Expected results) but as soon as it comes back to a complete stop it goes back to the glitched state. I am not sure if I am putting to much strain on heartbeat or why my code is causing this to happen. Any help would be nice
function update()
for _,v in pairs(AirFoils) do --Airfoils contants list of all airfoils
local Part = v[1]
local Constants = v[2]
local Velocity = Part.Velocity
local Area = Constants["Area"]
local FrontArea = Constants["FrontalArea"]
local AR = Constants["AR"]
local V2 = Velocity:Dot(Velocity)
local RelVel = Part.CFrame:VectorToObjectSpace(Velocity)
local LiftCoe = GetLiftCoeffient(Part,RelVel) --Calls function to get Lift Coef
local DragCoe = GetDragCoeffient(LiftCoe,AR) --Calls function to get Drag Coef
-- MaxVector justs return bigger magnitude in vector form
Part.VectorForce.Force = Part.CFrame:VectorToWorldSpace(MaxVector(Part.CFrame.UpVector * (V2 * Area * LiftCoe * 1.2),50000*TotalMass)+MaxVector(-Velocity.Unit * (V2 * FrontArea * DragCoe * .6),50000*TotalMass))
end
end
rs.Heartbeat:Connect(update)
Glitch Results:https://gyazo.com/0fb2cd636f556fc60d876bd6dbbd6912
Expected Results: https://gyazo.com/235cf12d15ec137bc4343f444914caa9