Skip to main content

External Forces Parameters

Parameters related to externally applied forces.

View Source

Gravity​

Gravity​

Gravity - Gravity vector applied to bones.

PropertyValue
TypeFVector
Default(0, 0, 0)
CategoryForce
// Apply downward gravity
Gravity = FVector(0, 0, -1.0f);

bUseLegacyGravity​

Compatibility with older gravity - Compatibility setting to match the gravity behavior of older versions (v1.19 and earlier). Leave it false for new setups.

PropertyValue
Typebool
Defaultfalse
CategoryForce (AdvancedDisplay)
ValueDescription
trueLegacy compatible (adds 0.5 * Gravity * dt^2 to position)
falseAnimDynamics compatible (adds Gravity * dt to velocity, then updates position)

In v1.22 it moved to the advanced (AdvancedDisplay) section of the Details panel. The sample has no exhibit for it. See Wind and External Forces for details.

bUseDefaultGravityZProjectSetting​

Use Project Setting Gravity - Flag to multiply Gravity vector by the project setting's DefaultGravityZ (absolute value).

PropertyValue
Typebool
Defaultfalse
CategoryForce

bUseWorldSpaceGravity​

World Space Gravity - Flag for whether to handle gravity in world coordinate system.

PropertyValue
Typebool
Defaulttrue
CategoryForce

Wind​

bEnableWind​

Enable Wind - Flag for whether to receive influence from WindDirectionalSource as external force.

PropertyValue
Typebool
Defaultfalse
CategoryForce

WindScale​

Wind Scale - Influence degree of wind from WindDirectionalSource. Used for compatibility with Cloth and SpeedTree.

PropertyValue
Typefloat
Default1.0
Edit ConditionbEnableWind == true
CategoryForce
note

WindScale is only effective when bEnableWind is true.

WindDirectionNoiseAngle​

Wind Direction Noise - Noise (angle) applied to wind direction from WindDirectionalSource. Adds randomness to the wind direction to soften mechanical-looking sway.

PropertyValue
Typefloat
Default0.0
UnitDegrees
Range0 or higher
Edit ConditionbEnableWind == true
CategoryForce

Simple External Force​

SimpleExternalForce​

Simple External Force Vector - Pushes the bones in any direction. Every step, SimpleExternalForce * DeltaTime is added to the position. Because of Verlet integration, the offset carries into the next step's velocity, so it acts as a steady push in one direction.

PropertyValue
TypeFVector
Default(0, 0, 0)
CategoryForce|External Force

bUseWorldSpaceSimpleExternalForce​

World Space External Force - Flag for whether to handle simple external force in world coordinate system.

PropertyValue
Typebool
Defaulttrue
CategoryForce|External Force

External Force Presets​

ExternalForces​

External Force Presets (Instanced Struct) - External force presets. Custom presets can be added in C++.

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Force|External Force",
meta = (BaseStruct = "/Script/KawaiiPhysics.KawaiiPhysics_ExternalForce", ExcludeBaseStruct))
TArray<FInstancedStruct> ExternalForces;

CustomExternalForces (Experimental)​

Custom External Forces (Instanced Property) - Custom presets can be added in BP/C++.

UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, Category = "Force|External Force",
meta=(DisplayName="CustomExternalForces(EXPERIMENTAL)"))
TArray<TObjectPtr<UKawaiiPhysics_CustomExternalForce>> CustomExternalForces;
warning

This feature is highly experimental. It may not work properly unless you click on the AnimNode or compile the Animation Blueprint.

Tag​

KawaiiPhysicsTag​

Filtering Tag - GameplayTag for filtering, used with ExternalForce, etc.

PropertyValue
TypeFGameplayTag
CategoryTag
// Apply external force using tag
FGameplayTagContainer FilterTags;
FilterTags.AddTag(FGameplayTag::RequestGameplayTag("KawaiiPhysics.Hair"));
UKawaiiPhysicsLibrary::AddExternalForcesToComponent(MeshComp, ExternalForces, Owner, FilterTags);

External Force Control via AnimNotify​

Version Info

Added in v1.17.0

External forces can be controlled during animation using AnimNotify.

AnimNotifyState External Force

Applying external force with AnimNotifyState

Runtime Control / Blueprint API​

External forces can be added and removed dynamically from Blueprint (AddExternalForce / AddExternalForcesToComponent / RemoveExternalForcesFromComponent). See the following for steps and signatures.

This page is the reference for external-force parameters. For actual usage, see the following guides.