Attempting to make wings with drag

I am attempting to make wing parts that have a drag effect on them similar as to what is done in the game Plane Crazy.

https://www.roblox.com/games/166986752/Plane-Crazy

I’ve had some success thus far, but have run into a problem that I’ve been unable to resolve myself in that the parts will completely bug out when knocked over or occasionally touched when falling and occasionally when being altered with studio tools while in test mode.

This is the current iteration of the script that I have and was used in the video

rs = game:GetService(“RunService”)
local v1 = Vector3.new
local PartMass = script.Parent:GetMass()
script.Parent.Velocity = Vector3.new()
script.Parent.RotVelocity = Vector3.new()

XFaces = script.Parent.Size.Y * script.Parent.Size.Z
YFaces = script.Parent.Size.X * script.Parent.Size.Z
ZFaces = script.Parent.Size.X * script.Parent.Size.Y

rs.Stepped:connect(function()
if script.Parent.Anchored == true then
script.Parent.Velocity = Vector3.new()
script.Parent.RotVelocity = Vector3.new()
end

v1 = script.Parent.CFrame:VectorToObjectSpace(script.Parent.Velocity)*-100

script.Parent.UpForce.Force = Vector3.new(math.clamp(v1.X,(XFaces*(PartMass*-100)),(XFaces*(PartMass100))),math.clamp(v1.Y,(YFaces(PartMass*-100)),(YFaces*(PartMass100))),math.clamp(v1.Z,(ZFaces(PartMass*-100)),(ZFaces*(PartMass*100))))

end)

UpForce is a VectorForce constraint parented to the part with it’s RelativeTo value set to Attachment0 and the attachment is at the center of the part.

Other attempts I’ve made have included but are not limited to:
-Using a LinearVelocity constraint which proved to be slightly buggier.
-Using AlignPosition constrain which, while proving to be completely stable, I have not found a way to make travel at an angle when falling.
-Having a tiny block on each corner edge, getting their velocities and combining them in the script, which was just about as buggy as the original script.

I’ve been fighting with this for a while now and haven’t had any luck up to this point, so any useful help would be greatly appreciated.

P.S. Excuse the way the script is formatted in this, I very rarely post to the devforms and don’t know how to format it properly.

here is an already finished wing Aerodynamic Brick - Roblox

1 Like

Thanks.
I’m doing some experimenting and tampering to see if I can get it to work the way I want.
I’ll post the results here when finished.

Unfortunately it does not work as needed.
It does indeed simulate drag well enough, even falling at an angle when rotated, and it is stable. However when welded to another part(s), rather be an area of drag where the other part(s) will attempt to fall faster than the wing panel, the entire assembly is slowed down by the same amount of force divided across all attached parts and their size even after updating to VectorForce, seeing that all legacy body movers have officially been depreciated.

That’s a weird formula, should be proportional to velocity squared

Here is my implementation for drag force on the XZ axis only. For a wing the area changes depending on direction so I’ll leave that up to you.

I’ll give it a try, however your script seems to apply a drag only at the center and is based around general velocity.
What I’m attempting to make is a script that calculates drag force according to the size of the part.
I.E. Less drag on a part surface that has less surface area (x,y) than on one of it’s larger surfaces (x,z).