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?
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?
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.