AddImpulse with no momentum?

Hello,

I have uploaded a video which shows up my actual problem:

Here is the relevant portion of the C++ code to pass the ball:

FVector impulse = ComputePassImpulse();

MeshComponent->SetPhysicsLinearVelocity( FVector::ZeroVector );
MeshComponent->SetPhysicsAngularVelocity( FVector::ZeroVector );

MeshComponent->AddImpulse( impulse, NAME_None, true );

As you can see, when the character is standing idle when I pass the ball, the impulse to give the ball is correctly computed. But when I move the character, the momentum of the character is added to the impulse I give to the ball, despite my calls to SetPhysicsLinearVelocity and SetPhysicsAngularVelocity with FVector::ZeroVector.

Is it possible to counter balance this initial momentum and call AddImpulse on a “not-moving” ball?

Thanks in advance

I think your problem is in your computePassImpulse function. If you post that we could probably help give you an answer.

Thanks for your input.

The ComputePassImpulse function is not the problem here, as it computes a correct force to apply to the ball when the character owning the ball is not moving.

But it’s not a problem anymore. I got rid of physics as soon as I make the ball move (be it a pass or a shoot) and compute the trajectory by myself using equation of motion. It’s much more accurate this way :slight_smile: