How to set texture index for each tile in tiled material?

I want to tile texture array in a single material, but so it takes an array of indices to select texture for each tile in the material from texture array. I’ve ended up with this solution:


But I need to replace selected CheckerPattern node with a material function that will take an array of indices as input, but I don’t know how to make it. I don’t want to use elements, because I use single plane to cover several blocks at once, so they have changeable size, therefore changable amount of elements (also I don’t know, how to setup elements :sweat_smile:). I know mostly nothing about materials, so there could be different solution, if you know how to solve my problem any way possible I’d be thankfull.

I’ve managed to deal with this! I’ve found this video with tutorial on how to pass array to a material, and with help of it i did this:
First there is an actor blueprint:



Index to Pos macro:

And here is the material:

(Texture Sample is Texture 2d Array with all types of blocks)
And for example if I fill Indices array with [0, 0, 1, 1, 0, 2, 1, 1, 0] and set UTiling and VTiling to be 3, then actor will look like this:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.