How to create a button "on clicked" event that can be used regardless of the spawned character?

Hi,
I want to access a functionality from within a UI widget, regardless of the character that’s spawned as the player chosen character.

The idea is that I’m creating an inventory and I want to add a button to show the inventory whenever the user clicks or touch it.

I successfully added a click event in the main character blueprint, and also another custom event that I’m calling in the widget graph using “Get Actor of Class”, to show the inventory widget.

The problem:
I have many characters that the user is allowed to choose from. Therefore calling the custom event based on a “Get Actor of Class” is making it working for only one character. I want the function to be available and working regardless of the character.

Here is screenshot of the main character blueprint for this functionality which is working normally with that character:

And here is a screenshot for the button in the widget graph:

It’s okay if there is a way to do it either in blueprints or in c++.

An interface to send a message to the “current” character would be you best bet

Thank you for your response. could you please show me an example?

I’m not a my computer but epics docs are pretty detailed on this one here’s a primer

I appreciate your input answer.

I have read the documentation, very useful, however I’m not good in creating blueprints. Maybe someone here could help with simple example :slight_smile: