UPrimitiveComponent::AddImpulse
#include "Components/PrimitiveComponent.h"
Access: public
Specifiers: virtual
Description
Applies an instantaneous impulse to the component's physics body. Requires physics simulation to be enabled.
Signature
virtual void AddImpulse(FVector Impulse, FName BoneName = NAME_None, bool bVelChange = false) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Impulse | FVector | The impulse to apply in world space. Units: kg*cm/s (or cm/s if bVelChange=true). | — |
| BoneName | FName | Bone to apply the impulse to (skeletal meshes). NAME_None applies to the root body. | NAME_None |
| bVelChange | bool | If true, the impulse is treated as a velocity change (mass-independent). If false, it is mass-dependent (force * time). | false |
Return Type
void Caveats & Gotchas
- • Has no effect if physics simulation is not enabled on the component.
- • bVelChange=false (default): impulse is mass-dependent — the same impulse value produces different velocities on heavy vs light objects. Use bVelChange=true for consistent velocity regardless of mass.
- • Units are in UE's centimetre scale. An impulse of FVector(0, 0, 500) on a mass-1 object adds 500 cm/s (5 m/s) of vertical velocity — scale accordingly.
Example
Launch a physics object and add a hit reaction C++
// Launch upward with consistent velocity regardless of mass
MeshComp->SetSimulatePhysics(true);
MeshComp->AddImpulse(FVector(0.f, 0.f, 800.f), NAME_None, true); // bVelChange=true
// Mass-dependent impulse for a hit reaction at a specific bone
MeshComp->AddImpulse(HitDirection * ImpulseStrength, FName("spine_02"), false); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?