ABANDONED hit a trigger box to lower number in a widget

I wanted to know whenever you hit a trigger box, the number in the widget will go down by 1. I have no clue what to do in this situation. And i hope you guys can help me. No I cant find a video online.


the basic answer is you need to bind the value of the number and have it set to a variable. in a actor in the level where your collision volume is you need to make a script that updates the variable. so on begin overlap cast to the widget, get the variable, subtract one, then set the variable. to do this you will need a reference to the widget. the easiest way to get a reference to the widget is from the blue return pin on the create widget node.

below is an example of one way to do this. i did it in the level blueprint because im lazy and dont have the time at the moment to make it its own actor.

I am not exactly sure on how to do this part. I’m kind of a beginner in UE4, this type of stuff will confuse me. Can you go through it for me?

the section you show in your picture is where i got a variable (keys) from the widget then i decremented it then i set the same variable to a new value. what you need to accomplish this is to first have a variable in your widget, then once thats done you need to drag off of the as keys (or whatever your widget is named) pin on the cast and in the search bar enter get keys (insert your variable name here). i shouldnt have named the widget and the variable the same thing.