Help me understand what you’re trying to do here.
- Trying to call some code from inside the widget blueprint?
- Trying to call a widget blueprint function from some other code?
- Something else?
The code you showed:
@button_local.@on_clicked is just referencing a local
@on_clicked variable but won’t result in calling anything.
OnClicked is a delegate and there currently isn’t a way to call the delegate directly. But you can call functions.
Since I think you’re attempting to do #2, I’d recommend making a BP function in your widget blueprint, for example
SelectButton. And make whatever calls you need to in the
SelectButton BP function. Then in your local constructor just call
Also your constructor named
!constructor is something I have not seen before, as constructors are typically just named
! in . One last thing to be aware of, widget’s can get constructed outside of an actual game world existing, so if you ever get a crash inside a constructor because some object doesn’t exist, remember me mentioning this.