Event Dispatchers: UMG to Blueprint Component possible?

I’m trying to have a UMG button fire an event in a blueprint component. I assume the event dispatchers are the correct method to use but I can’t for the life of me wrap my head around how these should be wired up. All the tutorials I’ve watched assume the events are being triggered in the level blueprint. I’ll take any suggestions on how to achieve this.

The exact effect I’m trying to create is this;

  • UMG Button is pressed - button will represent a material choice.
  • Material on all static mesh objects with the blueprint component added will change.

Thanks in advance

Have you watched my Tutorial? I cover Event Dispatchers in widgets communicating to BPs. Using them to communicate with Components would be very similar just an extra step.

Thanks for that - that’s a very informative and useful tutorial, I learnt a lot. BUT it doesn’t solve my problem and I’m beginning to think that I’m going about this the wrong way and/or it’s just not possible with blueprint components.

What I want is for the UMG to fire an event and then for all appropriate BPCs to be ‘listening’ for that event and act appropriately. It looks like event dispatchers trigger events on specific instances of a blueprint and not all blueprints of that same type. In your door example I would want ‘Open Door’ to open all the door blueprints on the level and not just the door clicked on. The second issue is with BPCs - unlike full blueprints they don’t have standard events like ‘On Clicked’, etc. and so that’s not a way for me to add interactivity to my levels. I want to use BPCs rather than full blueprints because I need to be able to add similar behaviours to a diverse set of static meshes, plus I want to be able to make the BPC resuable across many projects and not specific to a particular mesh - which is what will happen if I go down the full blueprint route.

I have the functionality I need working but all the logic is in the level blueprint and not in the BPC, all the BPC is doing at the moment is tagging meshes so I can find them on level creation with a mass ‘does actor have tag’ search. It means that my BPC is not really reusable across projects as I need bits from the level blueprint as well, so it’s not a simple matter of migrating it to a new project as I originally hoped.

I haven’t implemented any event dispatchers so I couldn’t help you with the fine details there, but generally as long as you have a reference you can do whatever you want wherever you want to do it.

So for me, instead of using an event dispatcher I have a kind of controller blueprint that manages traffic between the UI widgets. When I want things to happen, the widgets talk to the controller and it tells all the other widgets what to do.

Theoretically, you could get a reference to your level in your widget, and then use that reference to execute event dispatchers or whatever else. I don’t think that is 100% necessary, but it would at least get you started.