This may actually be more of a Physics.SE question but since im doing this in Unity I figured I'd ask here.
I am playing around with the Constant Force component and have a sphere constrained with a linear configurable joint (y-axis free). With one key I apply a force in one direction to get it moving, but then when i press another key, I want to stop it and hold exactly in place by using an opposite force. So even if some other rigid body hits the sphere, it wont move until I remove a force.
Unfortunately, Unity doesnt allow more than one constant force on a gameobject (probably a good reason, not sure exactly) and I know if I do a net force, that it would just end up being 0, which would kind of work but the sphere would move if it gets hit.
Another thing I tried was to take the spheres current force and constantly flip it from positive to negative every FixedUpdate but that didn't seem to work at all.
I know the quick and easy way would be to just set velocity to zero, but I see tons of comments saying that modifying velocity directly breaks the physics, is bad form, etc. and I want to do this as properly as possible.
The best way I can describe what I'm trying to do is like that science experiment where you take a ping-pong ball and use a blower to push just enough air to counter gravity and the ball seems to hover in place. My only difference is that my constraint is side to side instead of up/down.