FBoxParams for trace question

There is a vector called Extent that i need to put a value for in the FBoxParams for BoxTrace. What is that. My box trace is not working properly i think because of that.

Here is my code for th ebox trace and params

bool bNoLedge = GetWorld()->BoxSweepSingle(OutHit, Hit.Location + FVector(20, 0, 90), FVector(20,20,45), GetActorRotation().Quaternion(), ECC_PawnMovement, BoxParams);

FBoxQueryParams BoxParams(WeaponTraceTag, FVector::ZeroVector);

it is supposed to draw a debug box when the box with same parameters for start and end location of trace, and the debugbox is ok size i checked, but i think the boxsweep parameters are different. Is start the equvalent to center in debug box and end the equal to extent?

The BoxSweepSingle call will not draw anything. The Extent vector indicates the size of the box (X, Y and Z radius). If you are sweeping a zero-size box, you probably want to use a LineTraceSingle instead.

oh so the second parameter which is vector 20,0,90 defines the size? im confused on the size and location of the trace part

A trace with an extent simply extend the contact area of the trace. So the hit location returned will be located from a point inside the area defined by the vector (the center point being the center of trace, the vector extend the detection around).

It’s useful when you would like less precise detections, for example detecting an object in front of the player, if you use a regular trace (a line) you can miss the object while with the box/sphere you reduce the chances of missing it.

There was this example on the UDK forum which would illustrate correctly what I’m saying :

extent.gif