# Blueprint Line Trace - Off Hovered

**URL:** <https://forums.unrealengine.com/t/blueprint-line-trace-off-hovered/2377543>\
**Category:** Blueprint\
**Tags:** unreal-engine, please-help-me, question\
**Created:** [March 6, 2025, 9:51am UTC](https://forums.unrealengine.com/t/blueprint-line-trace-off-hovered/2377543 "2025-03-06T09:51:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![UrLocalMealMates](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UrLocalMealMates](https://forums.unrealengine.com/u/UrLocalMealMates)\
**Post date:** [March 6, 2025, 9:51am UTC](https://forums.unrealengine.com/t/blueprint-line-trace-off-hovered/2377543/1 "2025-03-06T09:51:00Z")

</div>

I am trying to make a pick up function in my project. Currently, I have the following code so when my line trace is over my item, Event On Hovered is called and it displays a widget (set visibility). I am unsure how to implement off hovered, or if I’m doing it the wrong way and there is a better alternative. Help would be appreicated 😃

Event OnHovered \> Set Visibility (New Visibility, true. Widget, target)

 ![Screenshot 2025-03-06 224141](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/3/fa3c7f1637bcd48c06830a02ef14694767954e9c.png)

---

<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:** [March 6, 2025, 9:56am UTC](https://forums.unrealengine.com/t/blueprint-line-trace-off-hovered/2377543/2 "2025-03-06T09:56:18Z")

</div>

Check this out, you will need more branches if you want to prevent spamming the interface messages 120 times per second:

> [@Moving an object by pointing another object at it](https://forums.unrealengine.com/t/moving-an-object-by-pointing-another-object-at-it/1657869/2):
>
> See if this point_down helps with this point_up_2 particular bit. a standard forward camera trace: You’d use an interface or inheritance if there are more types to handle, ofc. not sure how you want stuff to move, here it’s via a timeline: which results in: the branches in the script prevent it from spamming since we’re tracing on Tick: Hopefully you can adapt it to your needs. It’s a setup similar to this one:

And if you follow the link in that post, there’s a more elaborate example that actually uses an interface. The logic stays pretty much the same, though.

---

<div class="post-metadata">

**Author:** ![UrLocalMealMates](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UrLocalMealMates](https://forums.unrealengine.com/u/UrLocalMealMates)\
**Post date:** [March 6, 2025, 10:38am UTC](https://forums.unrealengine.com/t/blueprint-line-trace-off-hovered/2377543/3 "2025-03-06T10:38:35Z")

</div>

I’ve had a read and tried applying it but I can’t seem to comprehend but I do understand the extra branches. Will OffHovered be nessacery? and is there a way to dumb it down for me?

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [March 6, 2025, 1:18pm UTC](https://forums.unrealengine.com/t/blueprint-line-trace-off-hovered/2377543/4 "2025-03-06T13:18:20Z")

</div>

cache the hit actor, if new hitactor != lasthitactor then call unhovered on lasthitactor and hovered on newhitactor

you kinda need this anyway because you’re calling onhovered on tick, whereas if hitactor = lasthitactor then its already hovered if that makes sense

---

<div class="post-metadata">

**Author:** ![UrLocalMealMates](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UrLocalMealMates](https://forums.unrealengine.com/u/UrLocalMealMates)\
**Post date:** [March 6, 2025, 10:07pm UTC](https://forums.unrealengine.com/t/blueprint-line-trace-off-hovered/2377543/5 "2025-03-06T22:07:51Z")

</div>

Do you reckon you could provide an example?

---

<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:** [March 7, 2025, 2:24am UTC](https://forums.unrealengine.com/t/blueprint-line-trace-off-hovered/2377543/6 "2025-03-07T02:24:31Z")

</div>

The caching is in the 1st screenshot of the link I posted.
