Blueprint Line Trace - Off Hovered

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 :smiley:

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

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

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.

1 Like

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?

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

Do you reckon you could provide an example?

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

1 Like