# Use Box Trace By Channel To Set The Location and Extent Of A Box Collision.

**URL:** <https://forums.unrealengine.com/t/use-box-trace-by-channel-to-set-the-location-and-extent-of-a-box-collision/2677821>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [November 23, 2025, 5:01pm UTC](https://forums.unrealengine.com/t/use-box-trace-by-channel-to-set-the-location-and-extent-of-a-box-collision/2677821 "2025-11-23T17:01:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z3R0K0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z3R0K0](https://forums.unrealengine.com/u/Z3R0K0)\
**Post date:** [November 23, 2025, 5:01pm UTC](https://forums.unrealengine.com/t/use-box-trace-by-channel-to-set-the-location-and-extent-of-a-box-collision/2677821/1 "2025-11-23T17:01:01Z")

</div>

I have been trying to set an extent for my box collision based on the results of a Box trace by channel. I can find the mid point fine, but I’m struggling with how to set the box extent correctly.

 ![BP_Trace_To_Set_Extent-EventGraph](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/a/d/8adbe112ca2148b5d025fecf8e46ddd69fe3f3d4.png)

The Box Extent is always too long. If I divide by 2, its too small. In fact, if I divide by anything, it will make it the wrong size in different trace lengths.

Thanks for any help in advance.

EDIT\* It does not necessarily need to be done with box trace, It can be be done with sphere or line trace instead. Just trying to figure out how to do one axis first.

---

<div class="post-metadata">

**Author:** ![56legion](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/56legion/32/1194529_2.png) [@56legion](https://forums.unrealengine.com/u/56legion)\
**Post date:** [November 24, 2025, 1:18am UTC](https://forums.unrealengine.com/t/use-box-trace-by-channel-to-set-the-location-and-extent-of-a-box-collision/2677821/2 "2025-11-24T01:18:18Z")

</div>

Lower this value instead.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/7/4a7a302e1d8c4b214858f499b3352fc3e471bc19.jpeg)

---

<div class="post-metadata">

**Author:** ![Z3R0K0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z3R0K0](https://forums.unrealengine.com/u/Z3R0K0)\
**Post date:** [November 24, 2025, 6:49pm UTC](https://forums.unrealengine.com/t/use-box-trace-by-channel-to-set-the-location-and-extent-of-a-box-collision/2677821/3 "2025-11-24T18:49:54Z")

</div>

That is only affecting how far the trace will go. Changing it to a lower value only makes the trace go less distance. It’s still the same problem.

 ![Box_Trace](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/c/84c65ea9eeec607735a235dbd1bb702de20bcf89.jpeg)

I have lowered the value to 1000. Its the same difference. The red boxes are the start and end of the trace. The yellow box is the box extent size its getting and setting my collision box to, which is always bigger than it should be.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [November 24, 2025, 7:47pm UTC](https://forums.unrealengine.com/t/use-box-trace-by-channel-to-set-the-location-and-extent-of-a-box-collision/2677821/4 "2025-11-24T19:47:55Z")

</div>

![box1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/1/1b172ab25d4fa781fc3d71dacc8be942c5dcdcce.jpeg)

 ![box2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/a/6/8a6255ae3ce51f5ff0bfdb543fc4f8f13d439665.png)

Though you might get some slight offset as impact point takes into account the closest contact point so you might get some inter-penetration.

Alternatively in place of a box trace you could do a line trace.

Here you can see the trace impact point

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/2/82201939fb879edaf2c21fd869ad0fb97f0ab3df.jpeg)

To get a more accurate distance you would have to get the line parallel from the impact point to the actor rotation and then move that point along it’s axis to get to the center of the source of the ray. Still won’t give perfect results as it will cut the ray slightly short as the rotation is skewed.

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [November 24, 2025, 8:07pm UTC](https://forums.unrealengine.com/t/use-box-trace-by-channel-to-set-the-location-and-extent-of-a-box-collision/2677821/5 "2025-11-24T20:07:38Z")

</div>

There green distance pin value is avaliable and you can directly use it to mark up the lenght of the extent. Just place that into the proper location axis. (X of the make vector in your original case).

---

<div class="post-metadata">

**Author:** ![Z3R0K0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z3R0K0](https://forums.unrealengine.com/u/Z3R0K0)\
**Post date:** [November 24, 2025, 8:30pm UTC](https://forums.unrealengine.com/t/use-box-trace-by-channel-to-set-the-location-and-extent-of-a-box-collision/2677821/6 "2025-11-24T20:30:28Z")

</div>

> [@MostHost\_LA](#):
>
> There green distance pin value is avaliable and you can directly use it to mark up the lenght of the extent. Just place that into the proper location axis. (X of the make vector in your original case).

Thanks for the suggestion, unfortunately using distance is giving mixed results based on trace length.

> [@3dRaven](#):
>
> To get a more accurate distance you would have to get the line parallel from the impact point to the actor rotation and then move that point along it’s axis to get to the center of the source of the ray. Still won’t give perfect results as it will cut the ray slightly short as the rotation is skewed.

I have made a modification to your suggestion and I have achieved the correct size for what I needed. Thank you very much for pointing me in the right direction.

 ![BP_Trace_To_Set_Extent-EventGraph](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/6/e862a2ca5e5c6638243ff12c081f2eb57cb77e47.png)

Used a line trace instead of a box trace.

 ![Line_Trace](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/8/bb82540effbd20061bcaf33d73e2552916519f3c.jpeg)
