Working on a wing simulation and I was using this lift equation script I made up from NASA’s website.
local runservice = game:GetService("RunService")
runservice.Heartbeat:Connect(function()
local v2 = script.Parent.AssemblyLinearVelocity.Magnitude ^ 2
local density = game.Lighting.airDensity.Value
local liftCoefficient = 1
local dragCoefficient = 1
local lift = script.Parent.Lift
local wingLength = script.Parent.Size.X
local wingWidth = script.Parent.Size.Z
local wingArea = wingLength * wingWidth
local density2 = density * v2
lift.Force = Vector3.new(liftCoefficient * density2 / 2 * wingArea,0,0)
end)
Print out what @edozune said to print out, but my guess isn’t that the Y value is too big, but rather the Y value is increasing. If it is, it may have something to do with your airDensity calculation. Can you show us that?
@edozune@xendatro you guys keep saying to reduce values on it but its decreasing the overall lift which is a big problem. I do think it has something to do with velocity ^ 2 though. But all I can say is that I can’t really decrease those other values…
I am little confused, what are you trying to achieve here? Also you are not applying any value on y axis instead you are doing it on x axis is that what you wish to do?
It’s a vector force according to the attachment. So X is always local and is pointing in the direction of the attachment. If you watched the video the issue is that at the end the wing goes insanely fast upwards and I think I know what is wrong, angle of attack is nowhere in the lift coefficient or equation meaning that if the wing is sideways the velocity will increase dramatically and in turn make the lift more and so on and so forth.