Chaos Physics, Hits & Overlaps
UE5's physics engine is Chaos (it replaced PhysX). It simulates rigid bodies, handles collision queries (the traces from the last lesson), destruction (Geometry Collections), cloth, vehicles (Chaos Vehicles plugin) and ragdolls. Gameplay code mostly meets it through three things: simulating bodies, collision events, and the character movement component, which does not simulate physics at all.
Kinematic vs simulated
| Kind | Moved by | Examples |
|---|---|---|
| Static | nothing | level geometry |
| Kinematic / movable, not simulating | your code, animation, movement components | characters, doors, elevators, projectiles with UProjectileMovementComponent |
| Simulating physics | Chaos: gravity, forces, collisions | crates, ragdolls, debris |
ACharacter is kinematic: UCharacterMovementComponent moves its capsule with sweeps and its own rules for walking, slopes and steps. That makes characters precise and networkable. Pushing a simulating crate with a character works through the movement component's "push force" settings, not through real physical contact.
// A crate that simulates
Box = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Box"));
RootComponent = Box;
Box->SetSimulatePhysics(true);
Box->SetMassOverrideInKg(NAME_None, 40.f);
Box->SetCollisionProfileName(TEXT("PhysicsActor"));
Box->SetNotifyRigidBodyCollision(true); // "Simulation Generates Hit Events": needed for OnComponentHit
// Pushing it
Box->AddImpulse(FVector(0.f, 0.f, 50000.f)); // instant kick (kg·cm/s)
Box->AddImpulse(FVector(0.f, 0.f, 500.f), NAME_None, /*bVelChange*/ true); // ignore mass: +500 cm/s
Box->AddForce(FVector(1000.f, 0.f, 0.f)); // continuous: call every frame
// Box->AddRadialImpulse(Origin, Radius, Strength, RIF_Linear); // explosionsHit and overlap events
| Event | Fires when | Requirements |
|---|---|---|
OnComponentHit |
a blocking contact: a simulating body hits something, or a kinematic move is blocked by a sweep | for simulating bodies: Simulation Generates Hit Events; for movement: the move must be a sweep |
OnComponentBeginOverlap / OnComponentEndOverlap |
two components start/stop overlapping | both components need Generate Overlap Events on, and the responses must resolve to Overlap |
AActor::NotifyHit / NotifyActorBeginOverlap |
the actor-level versions | same rules |
// ArenaPickup.cpp
void AArenaPickup::BeginPlay()
{
Super::BeginPlay();
Trigger->OnComponentBeginOverlap.AddDynamic(this, &AArenaPickup::HandleOverlap);
}
// Must be a UFUNCTION with exactly this signature:
void AArenaPickup::HandleOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
bool bFromSweep, const FHitResult& SweepResult)
{
if (APawn* Pawn = Cast<APawn>(OtherActor); Pawn && Pawn->IsPlayerControlled())
{
// give the item, then:
Destroy();
}
}The signatures are long and easy to get wrong; copy them from the delegate declaration in PrimitiveComponent.h (FComponentBeginOverlapSignature, FComponentHitSignature).
Why "my overlap doesn't fire"
It is the most-asked Unreal physics question. Check in this order:
- Generate Overlap Events is on for both components (a character's capsule has it on; static meshes have it off by default).
- The responses resolve to Overlap (one side Ignore → nothing).
- Collision Enabled includes queries on both sides (Query Only or Query and Physics). Physics Only and No Collision components never report overlaps.
- The handler is a
UFUNCTION()and was bound inBeginPlay(orPostInitializeComponents). Dynamic bindings made in a constructor are a well-known source of trouble with Blueprint subclasses, so the convention is to bind later. - Use the console command
show Collisionto see collision shapes, and the Collision view mode.
A model: which events fire
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
enum Response { Ignore, Overlap, Block };
struct Comp { std::string Name; Response ToOther; bool GenerateOverlapEvents, SimHitEvents, Simulating; };
std::string Events(const Comp& a, const Comp& b) {
Response r = std::min(a.ToOther, b.ToOther);
if (r == Ignore) return "nothing (a side ignores)";
if (r == Overlap)
return (a.GenerateOverlapEvents && b.GenerateOverlapEvents) ? "BeginOverlap on both"
: "nothing (Generate Overlap Events off on one side)";
bool hit = (a.Simulating && a.SimHitEvents) || (b.Simulating && b.SimHitEvents) || !a.Simulating;
return hit ? "blocked + OnComponentHit" : "blocked, no hit event (Simulation Generates Hit Events off)";
}
int main() {
Comp capsule{"PlayerCapsule", Overlap, true, false, false};
std::vector<std::pair<Comp, Comp>> cases = {
{capsule, {"CoinTrigger", Overlap, true, false, false}},
{capsule, {"DecorMesh", Overlap, false, false, false}},
{capsule, {"GhostVolume", Ignore, true, false, false}},
{{"Crate", Block, false, false, true}, {"Floor", Block, false, false, false}},
{{"Crate", Block, false, true, true}, {"Floor", Block, false, false, false}},
};
for (auto& [a, b] : cases) std::cout << a.Name << " + " << b.Name << ": " << Events(a, b) << "\n";
}PlayerCapsule + CoinTrigger: BeginOverlap on both
PlayerCapsule + DecorMesh: nothing (Generate Overlap Events off on one side)
PlayerCapsule + GhostVolume: nothing (a side ignores)
Crate + Floor: blocked, no hit event (Simulation Generates Hit Events off)
Crate + Floor: blocked + OnComponentHit
Chaos features to know about
- Physical materials (
UPhysicalMaterial): friction, restitution and a Surface Type you read from traces for footsteps and impacts. - Geometry Collections / Chaos Destruction: pre-fractured meshes that break under strain; the Fracture mode in the editor creates them.
- Physics constraints: hinges and ropes between bodies (
UPhysicsConstraintComponent). - Substepping and async physics: Project Settings → Physics. Async physics runs the simulation on its own fixed tick, which is steadier but means gameplay reads results a frame late.
- Chaos Visual Debugger (recent 5.x releases): records physics frames for inspecting contacts and sleeping bodies after the fact.
Test yourself
Why doesn't a character push a simulating crate through real physical contact?
- Characters have no collision
- ACharacter is kinematic; CharacterMovementComponent moves it with sweeps and applies push forces by its own rules
- Chaos can't simulate crates
- Crates ignore pawns
A trigger and a static mesh never fire BeginOverlap, though both are set to Overlap. What is the likely cause?
- The trigger is too small
- Generate Overlap Events is off on the static mesh
- Overlap needs physics simulation
- BeginOverlap only works in Blueprints
Which setting makes a simulating body fire OnComponentHit?
- Generate Overlap Events
- Simulation Generates Hit Events (SetNotifyRigidBodyCollision)
- bTraceComplex
- Can Ever Affect Navigation