Download

Is there some way to choose tex by parameter in material editor?

i wanna create a material that could change texture by adjusting number of paramater in material instance or blueprint,is there any node like this or other way to make it?
dfsad.jpg

You can change textures in a material instance if you convert the texture in the material to a texture sample parameter 2D, and then you can just swap them out without having to recompile the material every time. Here’s a way to hook that up to blueprints: How do you change the texture on an object with blueprint? - UE4 AnswerHub

Eh, here’s a quick hack. Not promising it’s the best way to do it, but it works. I’ll assume you understand how to increase this from 3 options to 6 (you just copypasta the whole thing and continue incrementing the B values on the If nodes). If your TextureToUse parameter is invalid, the result will be black.
TextureSelector.png

im so grateful for your detailed solution.i saw this comment last time in company any forget to reply,sorry.my co-worker already solved it with something beyond my cognition(c++) :slight_smile: