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.

1 Like

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.

1 Like

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.

2 Likes

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.