# Line Trace 360 around mesh

**URL:** <https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160>\
**Category:** Blueprint\
**Tags:** line-trace, linetrace, unreal-engine, bounds, nodes, Blueprint, question\
**Created:** [January 19, 2024, 1:13pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160 "2024-01-19T13:13:32Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![XxpiingyxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxpiingyxX](https://forums.unrealengine.com/u/XxpiingyxX)\
**Post date:** [January 19, 2024, 1:13pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/1 "2024-01-19T13:13:32Z")

</div>

Like the title says, I would like to line trace 360 degrees around a mesh.

_I am sorry for any confusion this might cause you, but I have rewritten this question a lot of times now and I think I have made myself more and more confused for each passing minute._

I basically have a mesh that looks like a crocked pipe, and it is laying on/along the y axis. What I want to do is to get a point as close to the middle of this mesh. To do this, I am using the mesh Component Bounds Box (red in the picture) and Sphere (yellow in the picture) to then get a Line Trace start and a end points (green points, 4 pairs of points). With these points I am later on doing a back and forth line trace where I then use the Hit Points on the mesh to calculate the pair with the longest hit point distance. Then I get the point in the middle of those two hit points. This point is supposed to be the middle of the mesh.

 ![LineTrace_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/5/2a5dfc82e94bfbe594b0c103bde1482c35647415.png)

But as you probably already have guessed, this will not always give me an accurate answerer for where the middle point might be placed. If my brain is working correctly right now, I guess my problem would be solved if I did more Line Traces - almost like a 360 around the mesh.

Is there anyone out there that might know what I need to do or have a suggestion on what I can try?

_Is there even anyone out there that understands my brain right now? because I think I fried it._

---

<div class="post-metadata">

**Author:** ![baobao4435](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/baobao4435/32/950790_2.png) [@baobao4435](https://forums.unrealengine.com/u/baobao4435)\
**Post date:** [January 19, 2024, 1:42pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/2 "2024-01-19T13:42:36Z")

</div>

Looks so advanced to me. 🙂  
I totally don’t understand.  
To get center point I always just set the mesh pivot to where I like.  
And for the surrounding trace I would use sphere trace.

---

<div class="post-metadata">

**Author:** ![XxpiingyxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxpiingyxX](https://forums.unrealengine.com/u/XxpiingyxX)\
**Post date:** [January 19, 2024, 2:22pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/3 "2024-01-19T14:22:22Z")

</div>

I am using the “Get Component Bounds Origin” to get a point in the middle of the component Bounds, because I am not supposed to change the pivot in any way in this project.

You are mentioning Sphere Trace, does that trace from _outside in_ or _inside out_?

---

<div class="post-metadata">

**Author:** ![baobao4435](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/baobao4435/32/950790_2.png) [@baobao4435](https://forums.unrealengine.com/u/baobao4435)\
**Post date:** [January 19, 2024, 3:07pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/4 "2024-01-19T15:07:25Z")

</div>

The sphere trace is like the sphere collision component.  
You can use it for scanning a spherical range.  
Anything gets inside will give you his information.

---

<div class="post-metadata">

**Author:** ![baobao4435](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/baobao4435/32/950790_2.png) [@baobao4435](https://forums.unrealengine.com/u/baobao4435)\
**Post date:** [January 19, 2024, 3:15pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/5 "2024-01-19T15:15:55Z")

</div>

Like the tower defense games.  
Towers always do a sphere trace to scan the surrounding enemys.  
But I’m not sure if that’s what you want.

---

<div class="post-metadata">

**Author:** ![XxpiingyxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxpiingyxX](https://forums.unrealengine.com/u/XxpiingyxX)\
**Post date:** [January 19, 2024, 3:24pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/6 "2024-01-19T15:24:50Z")

</div>

Thank you, but no that’s not really what I want.

I kind of want like a hula-hoop with an amount of given points on it which will do a line trace to find exactly where inside the hula-hoop the mesh and its middle point is placed.

---

<div class="post-metadata">

**Author:** ![baobao4435](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/baobao4435/32/950790_2.png) [@baobao4435](https://forums.unrealengine.com/u/baobao4435)\
**Post date:** [January 19, 2024, 4:09pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/7 "2024-01-19T16:09:53Z")

</div>

I did a simple hula-loop.  
It’s kind of sucks.  
But hope it could help a little.

  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/a/d7a83028ed0c06f839755ecaad3ad9b965679659.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/e/28efe939e18f08622fa44e06340db9097ee03086.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/e/f3edfb79ea8c1b92d2db33642e36c402fdb47714.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 19, 2024, 4:30pm UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/8 "2024-01-19T16:30:20Z")

</div>

> [@XxpiingyxX](#):
>
> get a point as close to the middle of this mesh

Could you clarify what _the middle of the mesh_ would be for this 3d mesh:

 ![Sickle_model_BO](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/8/7b86ed2755b187f7d3421edcaed42b164355d663.webp)

---

<div class="post-metadata">

**Author:** ![XxpiingyxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxpiingyxX](https://forums.unrealengine.com/u/XxpiingyxX)\
**Post date:** [January 23, 2024, 7:24am UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/9 "2024-01-23T07:24:40Z")

</div>

Sorry for the confusion. By _The Middle of the mesh_ I mean a point that’s in the middle if you saw the mesh apart for example at every EdgeSlice.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/e/c8e5c02312ee14f52f5fa0318bc603397d607cb4.jpeg)

---

<div class="post-metadata">

**Author:** ![XxpiingyxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxpiingyxX](https://forums.unrealengine.com/u/XxpiingyxX)\
**Post date:** [January 24, 2024, 11:21am UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/10 "2024-01-24T11:21:25Z")

</div>

Thank you for taking you time to answer, but that is not what I am looking for.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 24, 2024, 11:33am UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/11 "2024-01-24T11:33:07Z")

</div>

> Line Trace 360 around mesh

It’s just this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/9/9a93416e99bd67b8eba6f972d76dbf7587a25d64.png)

X marks the spot:

This might be useless, really depends on what you need it for.

* * *

The built-in modelling tools allow you to find mesh centre to pivot around automagically, for example.

---

<div class="post-metadata">

**Author:** ![XxpiingyxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxpiingyxX](https://forums.unrealengine.com/u/XxpiingyxX)\
**Post date:** [January 25, 2024, 7:39am UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/12 "2024-01-25T07:39:29Z")

</div>

This works amazingly! Thank you so much 😃

---

<div class="post-metadata">

**Author:** ![XxpiingyxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxpiingyxX](https://forums.unrealengine.com/u/XxpiingyxX)\
**Post date:** [January 25, 2024, 10:59am UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/13 "2024-01-25T10:59:33Z")

</div>

If I want the Line trace to rotate along the y axis, is this how I should do it then? Because that doesn’t work, there is no line traces visible (the trace is visible when I change the values to be on Z).

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/8/6d8243ce3ae27a2039a3b8d547258876595a24ac.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 25, 2024, 11:02am UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/14 "2024-01-25T11:02:36Z")

</div>

Either X or Z, not Y, and not both.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/1/1/e11c518b2d2257c7aaed53ec7104722eeb1a1c5b.png)

* * *

You could get cheeky and add a plane (flag it as Hidden in Game):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/e/63e5d35396b5296aa5818155e1a5316c26340670.jpeg)

And then try:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/0/d60d491d4adbe85bdd5d9af710fc1b608dc9861c.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/5/fb5d9c0451c94eb455afca2aac795314ffc2b339.jpeg)

It’s easier to visualise the slice this way. Not sure if helpful but this way you do not need to punch in the values manually. Just rotate the plane.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 24, 2024, 11:03am UTC](https://forums.unrealengine.com/t/line-trace-360-around-mesh/1626160/15 "2024-02-24T11:03:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
