LineTrace and Blueprint Interface Message

Hi!

I have a line trace in my character blueprint, on hit it sends a message to interface blueprint - in my item actor I’ve added this interface, and when it recieve the message the widget show up. Problem is - how to give message to interface when line trace no longer hits object, to hide the widget?

1 Like

Ah, yes… :slight_smile:

Basically, you have a timer in the interactable actor. If the mouse over event keeps getting called, do nothing. If it hasn’t been called since the last time you looked, get rid of the widget.

This is why blueprint inheritance is a great thing. You only have to write that once…

Thanks for response, but I don’t get it :sweat_smile: Im using line trace in function in event tick on my character blueprint, and my item has a sphere collision. When trace hit the sphere collider Im using “hit actor” to call a interface message, but when line trace hits notting how to call a interface message?

When your trace hits the interactive object, you tell it ‘hey i’m looking at you’, with an interface call.

The interactive object then does two things

  1. Start a timer ( this is how often we check we are being looked at )

  2. Displays the widget ( saying, ‘open door’, or whatever ).

Because the player is line tracing to the door ( in this case ) every frame, the door is constantly getting the BPI call. Every time we get the call, we restart the timer from zero.

Eventually, the player looks away and we no longer get the interface message. But the player can’t say ‘I’m not looking at you anymore’, that’s what you’ve realized.

But… it’s ok because now the timer reaches 2 seconds, or whatever, and we turn off the widget.

Like that. Make sense now?

( you can also do it with a retriggerable delay ).

Here’s a basic version, so I’m mousing over

and in the actor

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