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.
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.
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.
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.
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.
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.