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.Yrs.Stepped:connect(function()
if script.Parent.Anchored == true then
script.Parent.Velocity = Vector3.new()
script.Parent.RotVelocity = Vector3.new()
endv1 = 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.