Download

How to Trigger a Function within a BP from a Widget BP using Event Dispatcher?

I have an actor BP that is essentially a wall/curtain that can drop or retract with a custom function “deploy curtain”. This function works fine.

I would like a HUD button that can be clicked to make all the instances of the BP in the level deploy (i.e., execute the function “deploy”).

The button is set up as a widget BP that is created when the player character begins play (so it appears on the screen on begin play). Within the widget the button calls an event dispatcher after casting to the curtain class (see image 1)

The curtain BP binds the dispatcher with a reference to the widget BP (see image 2)

When played however, nothing happens and I get an error saying “Accessed None trying to read property DeployAllCurtainsWidget” (image 3)…

Any thoughts on what I’m doing wrong?