Hello,
i am trying to script an engine, that will (partially) cancel the unintentional change of vertical speed (like pull of gravity) and leave the v-speed added by engines as it is/was. The closest i did come to this goal is:
Vector3d forceneut = FlightGlobals.getGeeForceAtPosition(vessel.GetWorldPos3D());
forceneut = forceneut.normalized * -((forceneut.magnitude*2/10)*Time.fixedDeltaTime);
foreach(Part p in vessel.parts)
{
p.rigidbody.AddForce(forceneut,ForceMode.Acceleration);
}
Unfortunately the v-speed is still decreasing.
What i want to accomplish:
- Flying in any direction, any location, at any horizontal speed, vertical speed (v-Speed) = 0 m/s and pointing up/down = 0° => v-Speed should remain 0 m/s
- Speed changes by engines, lift force, ... should not be influenced
What am i missing?
Thx