Skip to content
CRUSHFORMV1.1.0
GET IT ON FAB

REFERENCECOMPONENTS

UCFImpactFeedbackComponent

MODULECrushformImpactINCLUDECFImpactFeedbackComponent.hPARENTUActorComponent

Turns the rigid-body hits of one primitive into impact feedback events. Local to this machine: each machine judges the hits it sees and plays them through the impact feedback subsystem; nothing is relayed. A hit counts when its velocity change reaches Min Impulse Per Kg and it starts a contact or jumps within one, so a body lying on the ground stays silent. Set the primitive with SetObservedPrimitive.

Functions

AUTHORITY · server, every machineLOCAL · this machinePURE · read only
float ComputeIntensity(float ImpulseMagnitude, float MassKg, float OtherMassKg, float MinImpulsePerKg, float ImpulsePerKgForFullIntensity)
C++ ONLY

Intensity of a hit, 0..1, from the hit's impulse per kilogram of the hit body (that is, its velocity change in cm/s); negative when below MinImpulsePerKg. Against a body that gives way (OtherMassKg > 0; 0 for one that does not) the velocity change is raised to the speed into a fixed wall that takes the same energy (UCFDeformComponent::GetEnergyScale): a truck rammed by a car hardly changes speed, yet the crash is a crash.

uint64 MakeSourceId(const UPrimitiveComponent* Primitive)
C++ ONLY

The id an impact event carries for Primitive, so its cooldown holds whichever node or path the event came by.

void SetObservedPrimitive(UPrimitiveComponent* InPrimitive)
C++ ONLY

Sets the primitive whose hits are reported. May be called at any time; before Begin Play the component binds then.

UPrimitiveComponent* GetObservedPrimitive() const
PUREC++ ONLY

The primitive whose hits are reported; null until SetObservedPrimitive is called.

Properties

FGameplayTag EventTag
Category
Impact
float ImpulsePerKgForFullIntensity = 600.f
Default
600.f
Category
Impact
float MinImpulsePerKg = 50.f
Default
50.f
Category
Impact
float ContactGapSeconds = 0.1f
Default
0.1f
Category
Impact
float ContactSpikeRatio = 2.f
Default
2.f
Category
Impact