Adjust uvs automatically when resizing actor

I am trying to create a blueprint actor (with a static mesh component) that automatically adjusts the UVs of the material when I resize the blueprint actor in the level.

I started by using the basic cube mesh from the starter content, and in the construction script of my blueprint I create a MID from the ‘M_Concrete_Tiles’ material. I already adjusted that material to include two scalar parameters (UTiling and VTiling).

My problem is when I scale the blueprint actor in the x axis, for example, two of the cube’s surfaces are stretched incorrectly. But the other surfaces are correct.

When I scale in the y axis, all but two surfaces are incorrect.

Is it even possible to achieve what I’m trying to do? I’m pretty sure I’m doing something wrong in my blueprint (see picture). I should also have to use the z scale somehow? Do I maybe need one or more additional UV maps?

48355-bp_tiling.png

I guess a found a solution using this method: link text

Seems to work fine, I just had to adjust the Vector3 constant to 50,50,50.

There is also an “objectscale” node inside the material editor.
It outputs the scale of an object as a vector 3 (or X,Y,Z scalar) so you dont need blueprint stuff for it :slight_smile:
Combine that with some math and put that into the UV input of a texture sample.