Better way to do this?

Hi there!

I have a simple -text only- inspect system.

So when i press E, my character makes a linetrace and sends a message via interface to the object. And then, this object (bp) shows a widget with text in it.
So for example, i press E when pointing a barrel, it shows text onscreen “Just a barrel” or whatever.

The thing is… I have to make a widget blueprint for every object, and call it from each object. And each one with its own text and such.

Is there a better way to do this?¿

Thanks!

What about having the interface function return data.

For example, the function returns text. some pseudocode:
Message.
query: if text != null
mywidget.set text

So the widget would be created in your character.
As for creating a widget for every object; create one “information” widget, with a text variable that you can set.

Though you’d still need to provide the text in each class.

Make it so that if the object implement the interface, it returns a value that makes you know that it does.
Then, you use the bounding box of the object to place you widget on the object (Widget that is now attached to the player) and you change it’s text.
Also you can use ste1nar suggested too.