Addforce and addimpulse

I want to move a object at an constant speed should I use add force or add impulse?

Do those function could the effects of delta time or should I have to include it manually?

1 Like

to move at a constant speed you can control, you should use Velocity directly. Add Impulse basically does Velocity+=impulse. while AddForce is more like a thruster, it accelerates.

How can I add velocity directly unless it has a projectile component? I tried with impulse and force couldnā€™t achieve what I wanted.



StaticMeshComponent->SetPhysicsLinearVelocity(FVector(50.f, 0, 0));


This is setting the linear velocity directly so you get a constant velocity, not adding to it. Also make sure you enable physics simulation on the static mesh component.

AddForce accounts for delta time and should be used for applying force over more than one frame, AddImpulse does not account for delta time and should be used for single ā€˜pushesā€™, like from an explosion or being thrown by a player. The reason is that if you use AddForce for throwing or an explosion, how far the object moves depends on the framerate at the exact frame the force was applied, rather than being independent of framerate like AddImpulse is.

Just as a side note. ā€œImpulseā€ in physics is a force over a period of time. So it may confuse some people. Just worth noting.

Change in momentum (Or Impulse) = the force applied multiplied by the elapsed time

So I understand why youā€™re confused at the wording here because youā€™d consider deriving a proportion of that elapsed time into segments (frame time). But I guess thatā€™s not what it does (Considering The Beejā€™s response).

ā€¦on the other handā€¦

If we consider that the Impulse is, as it stands, already taking into account that entire system of changeā€¦ it, in itself, is the value of that computation. I suppose you would consider it to make sense if we were instead to say: ā€œI am applying this impulse, not as a function of time, but rather the value of that function of time. Ergo, it has already been computed - Thus itā€™s an immediate and entire affectā€

ā€¦ Still. worth noting.