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)
CategoryExternalForce
// Apply downward gravity
Gravity = FVector(0, 0, -1.0f);

bUseLegacyGravity

Legacy Gravity Method - Specifies the Gravity application method.

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

bUseDefaultGravityZProjectSetting

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

PropertyValue
Typebool
Defaultfalse
CategoryExternalForce

bUseWorldSpaceGravity

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

PropertyValue
Typebool
Defaulttrue
CategoryExternalForce

Wind

bEnableWind

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

PropertyValue
Typebool
Defaultfalse
CategoryExternalForce

WindScale

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

PropertyValue
Typefloat
Default1.0
CategoryExternalForce
note

WindScale is only effective when bEnableWind is true.

WindDirectionNoiseAngle

Wind Direction Noise - Noise (angle) applied to wind direction from WindDirectionalSource.

PropertyValue
Typefloat
Default0.0
UnitDegrees
Range0 or higher
CategoryExternalForce

Simple External Force

SimpleExternalForce

Simple External Force Vector - Allows applying force in any direction.

PropertyValue
TypeFVector
Default(0, 0, 0)
CategoryExternalForce

bUseWorldSpaceSimpleExternalForce

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

PropertyValue
Typebool
Defaulttrue
CategoryExternalForce

External Force Presets

ExternalForces

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

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ExternalForce",
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 = "ExternalForce")
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);

Blueprint API

External forces can be dynamically controlled from Blueprint.

Adding External Force

UFUNCTION(BlueprintCallable, Category = "Kawaii Physics")
static bool AddExternalForce(const FKawaiiPhysicsReference& KawaiiPhysics,
FInstancedStruct& ExternalForce, UObject* Owner, bool bIsOneShot = false);

Adding External Force to Component

UFUNCTION(BlueprintCallable, Category = "Kawaii Physics")
static bool AddExternalForcesToComponent(USkeletalMeshComponent* MeshComp,
TArray<FInstancedStruct>& ExternalForces, UObject* Owner,
FGameplayTagContainer& FilterTags,
bool bFilterExactMatch = false,
bool bIsOneShot = false);

Removing External Force

UFUNCTION(BlueprintCallable, Category = "Kawaii Physics")
static bool RemoveExternalForcesFromComponent(USkeletalMeshComponent* MeshComp, UObject* Owner,
FGameplayTagContainer& FilterTags,
bool bFilterExactMatch = false);

For more details, see UKawaiiPhysicsLibrary.