-
What do you want to achieve?
I want a realisticly flying airplane using minimum effort and equations. -
What is the issue?
It’s difficult finding a simple and correct formula to compute lift and drag. -
What solutions have you tried so far?
Currently I have a vehicle seat which contains two VectorForces (ApplyAtCenterOfMass = true) called Lift and Engine.
NOTE: The plane has a fixed bodygyro so it doesn’t rotate at all for now.
By updating every .1s I adjust the physics as shown below:
local wind = 0
if seat.Velocity.Magnitude > 0 then
wind = math.clamp(seat.CFrame.lookVector:Dot(seat.Velocity.Unit), 0, 1)
end
local lift_force = wind * math.sqrt(seat.Velocity.Magnitude) * LIFTFORCE
local pull_force = SPEED * ENGINEFORCE
local drag_force = 0
if wind > 0 then
drag_force = seat.Velocity.Magnitude ^2 * DRAG_FORCE
end
The resulting flight pattern is something like this.
This is because the wind variable decrease as the lift increase.
Increasing the drag, will cause this to swing back and forth in x axis like on a rubber band.
Anyone have any good ideas how to improve this?