# Exit for a line trace

**URL:** <https://forums.unrealengine.com/t/exit-for-a-line-trace/301052>\
**Category:** Blueprint\
**Tags:** hit-result, unreal-engine, Blueprint, question\
**Created:** [December 9, 2014, 9:41am UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052 "2014-12-09T09:41:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![HarshiniIsvi\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HarshiniIsvi\_1](https://forums.unrealengine.com/u/HarshiniIsvi_1)\
**Post date:** [December 9, 2014, 9:41am UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052/1 "2014-12-09T09:41:15Z")

</div>

When the ray hits an object The ‘Break hit Result’ has the actor’s information. How do I know when a ray leaves an object, I mean when it stops hitting or when it exits an object?

---

<div class="post-metadata">

**Author:** ![IceDDZ](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iceddz/32/88716_2.png) [@IceDDZ](https://forums.unrealengine.com/u/IceDDZ)\
**Post date:** [September 29, 2017, 2:02am UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052/2 "2017-09-29T02:02:34Z")

</div>

Can’t believe this hasn’t been answered. I’m looking for the equivalent of EndOverlap style event when you STOP hitting an object with a line trace. I.E. trace out to a button, when the actor is hit the button highlights, then when I STOP hitting the actor with that trace, I need an event to fire like the button not being highlighted anymore. I’ve found a work around for this, but it is all non-functional unless you’re using a CastTo node. I’m using Blueprint Interface Messages and it doesn’t work with them.

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [September 29, 2017, 2:05am UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052/3 "2017-09-29T02:05:27Z")

</div>

And are you sure that line trace is the right way to go ?  
It just sounds wrong for me, but maybe I don’t know some additional info ?

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [September 29, 2017, 2:14am UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052/4 "2017-09-29T02:14:44Z")

</div>

Anyway i doubt there is such event, since line trace is not built for it, it is no a persistent line and also the objects are agnostic to traces.

---

<div class="post-metadata">

**Author:** ![SmartPolygon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SmartPolygon](https://forums.unrealengine.com/u/SmartPolygon)\
**Post date:** [November 13, 2017, 9:43pm UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052/5 "2017-11-13T21:43:36Z")

</div>

Oh my gosh! I’ve been searching for a solution like forever! Banging my head here and cannot figure out how to do it…  
I want to end highlighting the button/door or drawer when I’m not pointing at it anymore…  
Any help?

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [November 13, 2017, 10:35pm UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052/6 "2017-11-13T22:35:44Z")

</div>

This is not how traces are working…  
Explain your problem and I will help you to pick the right tool.

---

<div class="post-metadata">

**Author:** ![Aetrix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Aetrix](https://forums.unrealengine.com/u/Aetrix)\
**Post date:** [June 4, 2022, 12:58am UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052/7 "2022-06-04T00:58:38Z")

</div>

Hi, I have solved this problem by combining linetrace with sphere-collider. Since linetrace doesnt have exit event we use sphere collider on contact position. Radius of Sphere collider can be whatever but lets say 20.0 units. We call this sphere a ‘hand’ and parent it inside our player. Each time our ray hits an object it set Hand location to that point. There you can use OnComponentBegin/EndOberlap to call LookAtObject and pass collided object. Only object that implements LookAtObject interface will have implementation how to do effects (hidden in game toggle). Hope this helps you.

---

<div class="post-metadata">

**Author:** ![Aetrix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Aetrix](https://forums.unrealengine.com/u/Aetrix)\
**Post date:** [June 4, 2022, 11:32am UTC](https://forums.unrealengine.com/t/exit-for-a-line-trace/301052/8 "2022-06-04T11:32:40Z")

</div>

I’m sorry I wasn’t here 5yrs ago… xD but solution is down. Let me know if it works for you. 🙂
