UCharacterMovementComponent::PushForcePointZOffsetFactor
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UPROPERTYEditAnywhereBlueprintReadWrite
Description
Vertical offset, as a fraction of the target object's height, for where push forces are applied. 0.0 is the object's center, 1.0 is its top, and -1.0 is its bottom.
Caveats & Gotchas
- • Only used when bPushForceUsingZOffset is enabled — otherwise the raw impact point is used directly.
- • Applying force away from an object's center of mass will impart torque, which can tip over top-heavy or unbalanced physics objects.
- • Has no effect unless bEnablePhysicsInteraction is also enabled.
Signature
float PushForcePointZOffsetFactor; Example
Push objects near their base to reduce tipping C++
if (UCharacterMovementComponent* MoveComp = GetCharacterMovement())
{
MoveComp->bEnablePhysicsInteraction = true;
MoveComp->bPushForceUsingZOffset = true;
MoveComp->PushForcePointZOffsetFactor = -0.5f;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?