Skip to main content

Collision Parameters

Parameters related to collision detection.

View Source

Collision Types

KawaiiPhysics supports the following 4 collision shapes.

TypeDescription
SphericalSphere collision
CapsuleCapsule collision
BoxBox collision
PlanarPlane collision

FCollisionLimitBase (Common Properties)

Base properties common to all collision types.

PropertyTypeDescription
DrivingBoneFBoneReferenceBone that the collision follows
OffsetLocationFVectorOffset position from bone (Default: ZeroVector)
OffsetRotationFRotatorOffset rotation from bone (Default: ZeroRotator, Range: -360 to 360)

FSphericalLimit (Sphere Collision)

Adds spherical collision detection.

UPROPERTY(EditAnywhere, Category = "Limits")
TArray<FSphericalLimit> SphericalLimits;

Properties

NameTypeDefaultDescription
Radiusfloat5.0Sphere radius (0 or higher)
LimitTypeESphericalLimitTypeOuterInner/outer limit type

ESphericalLimitType

ValueDescription
InnerLimit to inside the sphere (push bone inside the sphere)
OuterLimit to outside the sphere (push bone out of the sphere)

FCapsuleLimit (Capsule Collision)

Adds capsule-shaped collision detection.

UPROPERTY(EditAnywhere, Category = "Limits")
TArray<FCapsuleLimit> CapsuleLimits;

Properties

NameTypeDefaultDescription
Radiusfloat5.0Capsule radius (0 or higher)
Lengthfloat10.0Capsule length (0 or higher)

FBoxLimit (Box Collision)

Adds box-shaped collision detection.

UPROPERTY(EditAnywhere, Category = "Limits")
TArray<FBoxLimit> BoxLimits;

Properties

NameTypeDefaultDescription
ExtentFVector(5.0, 5.0, 5.0)Box extent (half size for each axis)

FPlanarLimit (Plane Collision)

Adds planar collision detection.

UPROPERTY(EditAnywhere, Category = "Limits")
TArray<FPlanarLimit> PlanarLimits;

Properties

NameTypeDefaultDescription
PlaneFPlane(0, 0, 0, 0)Plane definition

Loading from Data Asset

LimitsDataAsset

Collision settings can be loaded from a Data Asset. Recommended when you want to reuse settings across different AnimNodes or Animation Blueprints.

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Limits")
TObjectPtr<UKawaiiPhysicsLimitsDataAsset> LimitsDataAsset;

PhysicsAssetForLimits

Collision settings can also be loaded from a Physics Asset.

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Limits")
TObjectPtr<UPhysicsAsset> PhysicsAssetForLimits;

World Collision

bAllowWorldCollision

World Collision - Flag to perform collision detection with collisions in the level.

PropertyValue
Typebool
Defaultfalse
warning

Enabling this significantly increases physics processing load.

bIgnoreSelfComponent

Ignore Self Collision - Flag to ignore collisions (PhysicsAsset) owned by the SkeletalMeshComponent in WorldCollision.

PropertyValue
Typebool
Defaulttrue

IgnoreBones

Ignore Bones - Setting to ignore collisions (PhysicsAsset) owned by the SkeletalMeshComponent in WorldCollision (specified by bones).

PropertyValue
TypeTArray<FBoneReference>

IgnoreBoneNamePrefix

Ignore Bone Name Prefix - Setting to ignore collisions (PhysicsAsset) owned by the SkeletalMeshComponent in WorldCollision (specified by bone name prefix).

PropertyValue
TypeTArray<FName>

bOverrideCollisionParams

Override Collision Parameters - Set when using custom collision settings instead of SkeletalMeshComponent's collision settings for WorldCollision.

PropertyValue
Typebool
Defaultfalse

Collision Source Type

Enum indicating the source of collision settings.

UENUM()
enum class ECollisionSourceType : uint8
{
AnimNode, // Use values set in AnimNode
DataAsset, // Use values set in DataAsset
PhysicsAsset, // Use values set in PhysicsAsset
};
tip

Using Data Assets allows sharing collision settings across multiple AnimNodes and Animation Blueprints.

For more details, see Data Assets.