Hello! I have been working with an
open source helicopter script similar to a Jailbreak chopper.
Vertical: BodyVelocity Forward: BodyForce (Issue) BodyGyro: Turning & Tilt
My issue has been with BodyForce, as when I attempt to fly in forward motion it refused unless the aircraft is aligned at 90 degrees in relation to the map.
There are 3-4 other posts about this problem with the same script, and it seems to be where people start when attempting to script their own helicopters.
Test Place: TestPlace.rbxl (23.2 KB)
This is the original open-source physics update code.
BodyGyro.CFrame = CFrame.Angles(0, math.rad(turn), 0) * CFrame.Angles(math.rad(Tilt), 0, 0)
tru.Force = plane.Main.CFrame.LookVector * (-moving * 2 )
vel.Velocity = Vector3.new(0,height,0)```
Think about how your BodyVelocity and your BodyForce are interacting.
The BodyVelocity is trying to set the velocity to be straight upwards (or still) with no sideways movement.
The BodyForce, meanwhile, is trying to apply a sideways (and slightly downwards, because the part is tilted) force.
They’re fighting. The only reason its moving is because the Force of the BodyForce is high enough to sometimes win.
Don’t let them fight though. Either use the BodyVelocity by itself for up/down/left/right movement, or just use the BodyForce. The former is easier and simple and what I’d recommend. The latter is more realistic, but harder. It would work better if you had a gradual throttle rather than an on/off, because you don’t know exactly how much force the helicopter needs to lift off.
4 Likes