UCharacterMovementComponent::TouchForceFactor
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UPROPERTYEditAnywhereBlueprintReadWrite
Description
Force applied to any physics object the character touches while moving, scaled by the character's current speed.
Caveats & Gotchas
- • Has no effect unless bEnablePhysicsInteraction is enabled.
- • The resulting force is clamped by MinTouchForce and MaxTouchForce, so this factor only matters within that range.
- • If bTouchForceScaledToMass is enabled, the force also scales with the touched object's mass.
Signature
float TouchForceFactor; Example
Nudge small props on contact C++
if (UCharacterMovementComponent* MoveComp = GetCharacterMovement())
{
MoveComp->bEnablePhysicsInteraction = true;
MoveComp->TouchForceFactor = 1.0f;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?