Hello! I recently created a gliding system and would like some feedback on it. I’m aiming for a more skill-based gliding, so keep that in mind.
Game
Code for anyone who wants it
local wing = script.Parent
local strength = 1 -- Determines the strength of the lift force, basically
local f = wing.Attachment.VectorForce --Important to note that the part being manipulated has an attachment with a vectorforce as a child
game:GetService("RunService").Heartbeat:Connect(function(dt)
if wing.Velocity.Magnitude > 0 then
local aoa = wing.CFrame.UpVector:Dot((wing.AssemblyLinearVelocity+workspace.GlobalWind).Unit) -- The angle at which the wing is pointing compared to it's velocity
f.Force = -wing.CFrame.UpVector*wing.AssemblyMass*workspace.Gravity*aoa*strength*0.99 -- Applying the force
end
end)