pressed left click on object

i want to build a mouse event where it’s pressed on an object it triggers and event … how to go about doing so?
i have the player and game mode setup …
i have a a widget that needs to be triggered for switching material on the static mesh that is pressed left click on …
and when released on any of the icons in that widget (that represents the materials) it applies the material that the mouse is released on.

how can i achieve this?

Is this in game or in editor?

You could pass materials via the game instance. You can talk to it from widgets and blueprints.

Here. It’s very proof of concept, but it’s possible to pass material parameters through the game instance:

307862-clicks.gif

So the widget is just:

and the level BP: