Widget Prob

I have this blueprint that creates a widget when the player can pick an item up.
Whenever the player steps into the box collision, It creates it just fine, and it removes the widget when the player steps out of the box collision. But when the player presses E the widget dosen’t remove from the screen.

I think in this case the event Key E doesn’t fire on the blueprint in your screenshot at all because (guessing) this blueprint is not your player controller or pawn.

Also rapidly creating creating and destroying widgets is not a good practice.

Try something similar instead:

Pickup with widget component:

Character that picks up the closest pickup:

The array of nearby object is just for the test. You do you :wink:

Thanks for the response dZh0!!!

I searched for the get closest actor node, but I couldn’t find it. Is that a special function you made, or am I doing something wrong?

Yea it is custom. You can get all pickups, one at random or the one closest to your looking direction.

Here is the function but I’ve not tested so it might not work :wink:

It’s also taking the squared distance twice which can be avoided… Let me think of a better one - that takes whatever is closest to your screen center.

Gotcha!
Thanks!

On last thing.
Is the result in the function an actor class, and what are the little dotted V’s above you variables?

These are local variables - only available within function.

Here is the “closest to center of screen” one - also NOT TESTED.

You might want to filter out the ones behind you (with negative dot product).