How to stop a physics object in motion?

I am using the physics engine to handle the thrust on a flying ship and this works well. I would also like to press a button and have the ship rapidly decelerate into a hover state. I can achieve the deceleration by negating the velocity vector and applying a force in the resulting direction. However, this does not bring the ship to a complete stop and it instead hovers while slowly drifting downwards because of gravity.

How can I bring a physics object to a complete stop?

Blueprint for thrusting/acceleration. It looks overly complicated because it takes in the gamepad joystick input to control the thrust direction.

Blueprint for hovering/deceleration.

The ship is just drifting downwards? You could disable gravity in the physics options, or simply toggle it’s physics off when it reaches a certain velocity (near zero in xy), and enable it again when you thrust. Or, when entering hovering mode, add a physics constraint that stops the ship from moving on the Z axis.

@TeaLegend27 thanks for the suggestions. I did two experiments with disabling gravity.

  1. I tried disabling gravity when velocity gets below a certain threshold. This works but gives an unnatural look where the ship starts slowing down but then abruptly halts completely when gravity is disabled.

  2. The other approach is just to disable gravity when the hover button is pushed. This gives an abrupt stop but feels less hacky/unnatural than option 1.

Here’s a screenshot of option 2. If you have any suggestions on how to improve this that would be great.

Is this input being fired more than once? I am pretty sure that interpolation is not doing anything. For simplicity, I would recommend adding a physics linear damping (in xy) to the object, similar to how your toggling gravity. Use a timeline or interpolation there and raise or lower that damping value. That would give a very smooth, controlled stop, and subsequently an acceleration. For example:
slowdown
Just call these events like you’re toggling gravity. Add a float track, make it exponential, and have it go up to whatever damping value you want, over any amount of time.

@TeaLegend27 that was a great suggestion to change linear damping. The Triggered pin is executed every tick while the button is held, so I was able to use it to decrease linear damping at a constant rate. The effect is that the ship smoothly enters a hover state and eventually has velocity of 0.

However, I get unexpected behavior when the button is released and the Completed pin executes. I confirmed that in the Blueprint shown below the linear damping does indeed set back to its default value (0.8) but the ship stays suspended in the air. In other words, it’s as if gravity no longer acts on the object. Importantly, if I press the thrust button to apply a force the ship starts moving again as expected and also responds to gravity.

The unexpected behavior only happens when using linear damping to decelerate the ship to 0 velocity. Is this is a quirk (bug?) of the physics engine?

The solution to the problem described above was to include an Add Force node on the Completed pin. The key is to apply 0, 0, 0 force which dislodges the ship from its stuck position, allowing it fall as expected when the hover button is released.

This is a hacky fix to the odd behavior and I would welcome any comments on whether the issue I described above is a bug in the physics engine or if I’m overlooking something.