Download

Get different labels when selecting different objects

Hello,

I am trying to build an interactive game where I select objects and obtain an informative label for each object.

I have created widgets to show a different text for every different object (so 10 widgets for 10 objects, for example).
I was wondering if there is a way of just creating one widget where I can print any text, and then linking a different text to the different objects, so that when I put the mouse over one of them, the corresponding text is displayed via the same widget. Do I need to use a HUD for this?

I am new with Unreal so I do not know how to do this at all. If you could provide a graphic example of the blueprint/s I should have that would be really helpful.

I attach a file with my level blueprint.

Thanks a lot,
Laura

Making 10 widgets for 10 objects is really the hard way of doing it. In order to only use one widget, create a struct on your object blueprint. In the struct include the info you need, name, description, value, icon, weight, etc. Then within your widget, just dynamically change the elements like the text box or image based on whichever object is selected.

Maybe upon overlap of the object or upon click on the object, you cast to the pawn, get the Info widget and update all the variables based on your struct. You can toggle the visibility of it this way too.

Hope this makes sense.