UCharacterMovementComponent::AddForce
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallablevirtual
Description
Queues a continuous force to be applied to the character, scaled by mass and accumulated across multiple calls within the same tick.
Caveats & Gotchas
- • Forces are divided by Mass before being queued, so a zero or near-zero Mass logs a warning and the force is dropped entirely rather than producing an extreme result.
- • For a one-off instantaneous force (e.g. an explosion), use AddImpulse() instead — AddForce() is scaled by DeltaTime each frame, so a single call only nudges velocity slightly rather than applying the full magnitude at once.
Signature
virtual void AddForce(FVector Force) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Force | FVector | Force to apply. Accumulated with other forces queued this tick. | — |
Return Type
void Example
Apply continuous wind force C++
void AMyCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (bInWindZone)
{
GetCharacterMovement()->AddForce(WindDirection * WindStrength);
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?