How to use a string from a data table to update image in UMG
Ok this is an interesting one because I found a lot of varied ways to do this in a round about way but a lot of them required C++ and I just don't feel competent with coding and I feel like there must be a blueprint way to do this.
I have a data table for my AI guys. Among the things it tracks by levels, is a class icon. In my AI UMG file, I have The AI level, name, health bar and class icon. I have a default icon set but I want to know how to use the file location set in the data table to show the appropriate icon.
asked May 28 '17 at 07:32 PM in Blueprint Scripting
I think this should work. First by setting the table asset, you'll get the rows. Then by determining the row index, it will return the corresponding row. Then by breaking it, you will be able to get the specific row element. From there you can get all data you want.
I think that shouldn't be a string type in the datatable, rather a TAssetPtr type (if I remember well). That way you should be able to just set it.
answered May 29 '17 at 07:27 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here