The problem is that when a player clicks 5 ou 6 times rapidly, the widget does not want to disappear anymore, and the widget (the text) remains displayed…
Any idea on how I can make it disappear and reappear when I click on it ?
The GET’s are validated gets for the mywidget variable he got that by promoting the output from the top create widget to a variable (option when pulling the pin out of return value.
Validated gets check if the variable has anything in it and then does something different depending on that check
As above, right clicking any pin allows you to Promote To Variable - make a new variable that can be assigned data, this way the variable is already of the correct type:
If you promote a float - you get a float var, if you promote an actor - you get an actor reference and the same goes for a widget. We can use a reference like that to manipulate an object, access it and its data. More on variables:
Once you have a variable, you can either Get (read) or Set it (write to / assign data). If you Get a reference variable, you can then right click it again to turn it into a Validated Get variant:
The script you had up there was creating a brand new widget every time we clicked. If you clicked 100 times, you had 100 widgets sitting in memory, doing nothing. We could not see them as they were Collapsed.
As you can imagine, this is not great use of resources, the memory footprint would grow over time and lead to a memory leak.
What I suggested creates one widget only and keeps it alive, if we need to show it again, we show the widget that was created previously rather than make a new one.