In my game I created an ActorComponent to store and handle player abilities. Whenever an ability is added (or removed) an event dispatcher is called to signal, that the abilities have changed (see screenshot)
Whenever I call the function on the blueprint everything runs and the dispatcher is called (confirmed that already).
However: The UI does not receive the call, even though it is bound before the AddAbility function runs. Now, when I do the same in the PlayerCharacter blueprint, the call is received and the custom event called.
Where is the problem in my setup? What did I miss, or is this a bug?
I believe I know what the problem is. For the OP, his cast to the player state blueprint is failing. So in other words, the flow of execution stops at that point. It never reaches the bind event. I can see more wrong with that original picture than what I just mentioned, but that’s beyond what matters at this point. I’m not entirely sure why he was trying use the player state for that logic but even when I made a custom game mode and set it to use my custom player state, the cast still fails. I would suggest in that context to use the player character for that particular logic.
First create the event dispatcher inside the player character and then make sure that you use the player character blueprint as the target for the event dispatcher binding. Any event dispatcher target has to be a reference of the blueprint where that binding is created. That is one of the other problems I noticed with the op’s logic.
Aside from that, if you cast to the current player character bp that you use in your game the cast will never fail and will see that the bind event works.
I included a couple screenshots of some logic I put together to show how event dispatchers are supposed to be used.
The reason for the event not firing had nothing to do with the cast failing (which, in my case didn’t).
The real reason was a improper RPC setup. The event was called from the server, and since the UI isn’t available on (dedicated) servers it never got to the UI.