Texture based on Array?

Hello guys :slight_smile:

I would like to change the texture on the HUD based on an integer variable. I created an array list with my texture names, so every texture name has a reference number now like this:

0 - texture01

1 - texture02

2 - texture03

etc.

Not sure how to proceed from here. How can I connect my array output to define the texture input? This is where I would like to feed this data:

To be clear: I have a variable integer number, lets say a level counter, and every level has its own texture. I would like to set the texture based on the integer variable. I have loads of textures so connecting them manually is not an option but a pain.

Any help is really appreciated, I’m stuck here for days now :slight_smile:

Hello again :slight_smile:

I managed to pair up the Level Counter variable and the List of Textures array. I gave it a try and works fine with Print String, however I’m still stuck at the point where I should feed the name of the texture to the Draw Texture node. Any ideas on that?

It’s not a name that you should supply, it’s the texture structure itself. Try creating an array of texture2d structures by simply creating a new variable and typing in “Texture2d” in the menu where you pick int/float/string. You can make it into an array/list. Then all you have to do is to rewire the blueprint to get the texture from it instead of a list of strings.

Yes, yes, yes! That’s it! You, good Sir, are a genius! Much obliged :slight_smile:

Can you post a screenshot of what you ended up with? I realize ‘a little bit’ of time has past.

I have this working for the most part but what did you do to choose the correct treasures with the integer ‘filter’?

The last picture has the solution. Put the textures in an array (rather than the names), then select based on array index by the “Get” node. Thats it :slight_smile: