Download

Button OnPressed

I will try one more time cuz its really important to me. Is it possible to fire Button event OnPressed when it is being overlapped by other actor in my game? I’m talking about 3d widget button that is in the game. Thank you!

One way to do it: create a *CustomEvent *in the widget and hook it up to the same bunch of nodes as the button’s OnPressed

d3f9289b7fa8ee76c02f0a7bd9c1200367076f23.png

Ok, and fire this Custom Event when button is overlapped?

It doesn’t work

Short answer is; yes. But more information would be nice to help you achieve what you want.

If I’ve understood you correctly, you have a 3D widget in world space which you’d like to interact with? The Widget Component has overlapping events as well as OnComponentHit. You should be able to use either of those.

If a hit is detected and the actor is a child of the class you want, you can cast to the widget and execute a custom event. While I haven’t actually tried this myself, I assume this is how it would work. And assign the OnClicked event in your widget blueprint;

I think you are having an issue with obtaining a reference to the widget rather than firing an event. Can you confirm or at least show us a screenshot of your blueprint.
What Dealman suggested would work but you’d need to set up a Dispatcher which is actually somewhat more complicated.

This is Event Graph from Actor which has Widget component added to it:
2355ff8257ac4ce21c9aff354cd640adf0264cd9.png

This one comes from Widget with Button:
f9e0d8445c1f279f9162573a2f348d5c30437305.png

Custom event is fired (I get “BUTTON CUSTOM EVENT” notification) but OnPressed is not.

Do what I did in my first post.

I did, the custom event is fired but the button is not pressed (I know it because it should change its color and it doesn’t)

9fbd1723cb25ece0ffc3181116ad9a8b54f3d798.png it prints the string but button doesnt change it color