Exit for a line trace

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?

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.

2 Likes

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 ?

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.

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?

1 Like

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

1 Like

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.

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