Skip to content

Sphere Trace, Capsule Trace, and Multi Trace Basics

At a glance

Lives in: Blueprint API / Collision - Target: Kismet System Library - Returns: single traces return Boolean plus one FHitResult; multi traces return Boolean plus an array of FHitResult values - Fails by: returning false for no blocking hit, often with an empty or non-useful hit result/array - Main inputs: Start, End, shape size, trace channel, trace complexity, ignored actors, and debug drawing - Official docs: Sphere Trace By Channel, Capsule Trace By Channel, and Multi Sphere Trace By Channel

The one-minute version

  • A shape trace is a sweep: Unreal moves an invisible sphere, capsule, or box from Start to End and asks what it hits.
  • Use a shape trace when a zero-width line trace is too exact: melee swings, forgiving interaction, shotgun pellets, aim assist, or "can this capsule fit here?" checks.
  • Sphere Trace By Channel returns the first blocking hit touched by the swept sphere.
  • Capsule Trace By Channel does the same with a capsule shape. The common Blueprint node uses radius and half-height, which makes it useful for character-sized sweeps.
  • Multi trace nodes return an array of hits sorted from start to end. For channel multi traces, the blocking hit is last if one exists.
  • Shape traces do not spawn objects, apply damage, move actors, or keep checking after the node runs. They are queries.

What a shape trace actually does

A line trace asks about a mathematical line segment. A shape trace asks about a volume swept through the world.

pseudocode of the engine behavior - not engine source

function SphereTraceByChannel(World, Start, End, Radius, TraceChannel, Options):
    Shape = sphere with Radius
    Params = collision query params from Options
    Params.ignored actors += ActorsToIgnore and maybe self

    Hit = World.SweepSingleByChannel(Start, End, Shape, TraceChannel, Params)
    draw debug shape/line if requested
    return Hit.foundBlockingHit, Hit

The query still has a line from Start to End, but the thing being moved along that line has thickness.

Line trace:
Start o-----------------------------o End

Sphere trace:
Start (o)===========================(o) End

That thickness changes both gameplay feel and hit math. A sphere trace can hit a wall before its center reaches the wall because the sphere's surface touches first. That is correct. The shape has radius.

Sphere vs capsule

Pick the shape that matches the question.

Shape Good for Watch out
Sphere trace Forgiving aim, radial-ish melee checks, interaction around a point, shotgun pellet thickness. Radius can catch nearby targets the crosshair did not exactly cover.
Capsule trace Character-sized sweeps, upright melee volumes, "would this pawn-shaped volume hit?" checks. The common Blueprint node is radius + half-height, not a custom rotated weapon capsule.
Box trace Rectangular volumes, broad sword/hammer sweeps, placement checks with box-like bounds. Orientation and extents matter; easier to over-hit than a sphere.
Line trace Precise ray question. Too thin for many player-feel interactions.

For a melee helper:

Start = weapon socket previous location
End = weapon socket current location
Sphere Trace By Channel
    Radius = 20 to 40
    Trace Channel = Weapon

For a forgiving interact check:

Start = CameraLocation
End = CameraLocation + CameraForward * 250
Sphere Trace By Channel
    Radius = 12
    Trace Channel = Interact

For a character-sized placement check:

Start = candidate start
End = candidate end
Capsule Trace By Channel
    Radius = character capsule radius
    Half Height = character capsule half-height

Do not pick a large radius to hide bad start/end math. First prove the query is pointing the right way with debug drawing, then tune forgiveness.

Single vs multi trace

Single trace answers "what is the first blocking thing?"

Sphere Trace By Channel
-> Return Value
-> Out Hit

Multi trace answers "what hits did this query encounter along the way?"

Multi Sphere Trace By Channel
-> Return Value
-> Out Hits array

For channel multi traces, Unreal reports hits in trace order, and the first blocking hit ends the useful travel for that channel. If a blocking hit exists, it is last in the returned array. That means:

  • use the array when you need to inspect several candidates;
  • do not assume the first array element is the final target;
  • filter ignored teams/owners/components before applying gameplay;
  • de-duplicate actors when one actor has several components;
  • check both Return Value and array length when your design cares about overlap/touch results as well as blocking.

Shotgun-style logic often uses several separate line or sphere traces, one per pellet direction. A cleave or shockwave might use one multi shape trace and then filter all actors in the returned array.

Reading the hit result

Each hit is still an FHitResult. The familiar fields still matter:

Field Shape-trace note
Hit Actor Actor that owns the hit component. Filter this before gameplay.
Hit Component Exact component touched by the sweep. Useful for shields, capsules, weak spots, and duplicate filtering.
Impact Point Point on the surface the swept shape touched.
Impact Normal Surface normal at the contacted thing. Good for decals and impact effects.
Location Where the swept shape ended up for that hit. For shape sweeps, this can differ from Impact Point.
Distance Distance along the query when supplied by the query path.
Start Penetrating The shape began already inside something. Treat this as a setup/debug signal.
Physical Material Surface data, if requested and available.

The Location vs Impact Point distinction surprises line-trace users. For a swept sphere, the sphere center can stop at one location while the contact point on the wall is radius units away.

When it fails or lies to your intuition

Shape trace failure usually looks like Return Value = false, an empty array, or a hit that is not the actor you expected.

Common causes:

  1. Wrong trace channel. The target must block the trace channel for a single blocking result.
  2. Target has no query collision. Shape traces are collision queries; purely visual geometry may be invisible to them.
  3. Start/end are wrong. A thick shape swept in the wrong direction still gives wrong answers.
  4. Radius or half-height is too large. The query catches nearby walls, floors, or the player before the intended target.
  5. You did not ignore self. The shape starts inside the character, weapon, or owner and immediately reports that actor.
  6. The query starts penetrating. The shape begins already overlapping or inside geometry, so normals/locations can be less intuitive.
  7. Trace Complex is wrong for the asset. Simple collision and complex mesh triangles can produce different answers and costs.
  8. Multi result was not filtered. You damaged every component hit instead of every valid actor once.

Failure does not retry with a smaller shape, choose a different channel, or apply damage. Branch and handle the empty path.

What shape and multi traces do not do

  • They do not move the actor that owns the Blueprint. They only query.
  • They do not create a projectile, beam, hitbox, or lingering volume.
  • They do not apply damage, interact, or pick up items.
  • They do not automatically ignore the weapon owner in every graph.
  • They do not guarantee one hit per actor.
  • They do not replicate. Run authoritative hit detection on the server when the gameplay result matters in multiplayer.
  • They do not replace collision events when you need continuous begin/end overlap state.

The pattern everyone actually uses

For a forgiving interact trace:

Input Interact
-> Camera Location
-> Camera Forward * 300
-> Sphere Trace By Channel
   Radius = 12
   Ignore Self = true
   Trace Channel = Interact
-> Branch Return Value
-> Break Hit Result
-> Hit Actor
-> Does Implement Interface BPI_Interactable
-> Interface Message Interact

For a melee swing using repeated traces during a notify state:

Notify State Begin
-> clear HitActorsThisSwing set

Notify State Tick
-> PreviousSocketLocation
-> CurrentSocketLocation
-> Sphere Trace By Channel Radius 30
-> if hit actor is valid and not in set:
       add to set
       Apply Point Damage or Apply Damage

Notify State End
-> clear/stop tracing

For a multi-hit sweep:

Multi Sphere Trace By Channel
-> ForEach Out Hits
-> Break Hit Result
-> Hit Actor
-> skip None, self, owner, already processed actors, same team
-> apply gameplay once per valid actor

The C++ twin, for the curious (our own example code):

void ATrainingCharacter::SweepInteract()
{
    const FVector Start = Camera->GetComponentLocation();
    const FVector End = Start + Camera->GetForwardVector() * 300.0f;

    FCollisionQueryParams Params(SCENE_QUERY_STAT(SweepInteract), false);
    Params.AddIgnoredActor(this);

    FHitResult Hit;
    const bool bHit = GetWorld()->SweepSingleByChannel(
        Hit,
        Start,
        End,
        FQuat::Identity,
        ECC_Visibility,
        FCollisionShape::MakeSphere(12.0f),
        Params);

    if (!bHit || !IsValid(Hit.GetActor()))
    {
        return;
    }

    IInteractable::Execute_Interact(Hit.GetActor(), this);
}

Lookalikes - which one do I want?

Node Use when Watch out
Sphere Trace By Channel A ray needs circular forgiveness. Radius changes where the hit occurs.
Capsule Trace By Channel An upright capsule-shaped sweep matches the question. Half Height is center-to-endcap, not total height.
Box Trace By Channel A box-shaped volume fits the gameplay. Extents and rotation are easy to misread.
Multi Sphere/Capsule/Box Trace Several candidates along the sweep matter. Filter and de-duplicate hits.
Line Trace By Channel The precise first blocking ray hit is enough. It has no thickness.
Trace For Objects Object types, not a trace channel, define what can count. It asks a different filtering question.
Component Overlap / Get Overlapping Actors You need current overlap state now. It is not a swept ray/shape over a segment.
On Component Begin / End Overlap You need ongoing enter/exit events. Event state differs from one-shot trace state.

Rule of thumb: line for precision, sphere for forgiveness, capsule for character-like volume, box for rectangular volume, multi when more than the first target matters.

Going deeper