Stopping a ball from rolling (dead stop)

Hi there,

I am testing some physics and using AddImpulseAtLocation to apply velocity to a ball, but when I try to stop it with SetPhysicsLinearVelocity it doesn’t completely stop.

For context, I am looking into the design of shooting a cue ball at other balls on a pool table.

I’ve not tried with Blueprints, but I assume the same issue and solution applies.

Thanks in advance.

Update:

I tired having my stop function set a bool to true, then attempt SetPhysicsLinearVelocity(FVector()) on every tick until it is zero.

I logged when the impulse was applied, when the velocity is zero, when a stop attempt is applied and when the stop function has finished trying.

It does actually come to a dead stop, but right after it starts accelerating again almost as if some impulse has occurred again (when it has not).

I am rather confused.

Possible solution: Just do SetSimulatePhysics(false) then SetSimulatePhysics(true), even on the same tick.

This worked for my needs. I can even use it to stop a ball while it is bouncing and so it starts falling all over again from that location.

Hope this helps someone if they ever come across this :slight_smile: