Dynamic Material that Adjusts the texture coordinates

I have been trying all day to figure out a way to dynamically adjust a texture in a material. I would like to have one texture that stores a map. Based off 2 properties on my objects I would like to adjust how that texture is cropped and placed on my object. Example:

Texture - Top down map of a tavern
Objects: Box pieces that represent a map tile.

Goal: Have the texture cropped and placed on the box pieces based on 2 integer variables in the objects blueprint.

Is this possible? If so, what material functions am I looking for? Thank you.

  • Josh

Look in the Tappy Chicken game Sample at the Chicken Material, I am offsetting the UV’s inside the material to animates the chicken. You could do something similar to that.

Awesome, thank you!

Here is a pic of my material. I used your material as a reference but added a way for me to link my BP to the material. It sends the row and column of a map grid to get the correct UV placement. Thanks again for pointing me in the right direction.