Substitution not supported in hex literals?

I’m trying to make a serialized system where I have many items with different names, eg. name1, name2 etc. I have images named <name>_icon, so for example name1_icon, name2_icon. I’m trying to join the name and suffix with substitution when getting the image like this

assets.image`${variableWithName}_icon`

Unfortunately, this does not work, I get the “substitution not supported in hex literal” error. I don’t see a workaround. Is there another way, and if there isn’t what is the possibility of this feature being added?

3 Likes