Hey, I’m scripting a rocket that is moved by a VectorForce, and the force is updated every frame with this equation:
force.Force = Vector3.new(0, 1 * power - drag * speed, 0)
where 1 is the throttle (useless for a rocket, since the only throttle it really can be is 1), power is some constant that was predetermined, drag as well, and speed being the current Y velocity of the rocket.
When the rocket runs out of fuel, I want it to be as if the engine cuts off - no more accelerating, but it doesn’t just start falling out of the sky immediately. I want it to retain it’s velocity, but deaccelerate. When the rocket runs out of fuel, the equation changes to:
force.Force = Vector3.new(0, 0-drag*speed, 0)
since there is no power because the engine cut off, I substituted 0 for power. The rocket starts falling out of the sky extremely fast with this.
Every other method that I’ve tried gives the same results, except for this one where the rocket does indeed deaccelerate, but it is not the behavior that I want because the deacceleration slows over time and the rocket eventually stabilizes at a speed:
force.Force = Vector3.new(0, beforeForce - drag*speed, 0)
beforeForce being the current Y force of the VectorForce. I’m thinking of this like controlling a car in games; you let go of W but do not apply any brakes, and it keeps going but eventually comes to a stop. Any support would be appreciated, thanks.