Meterial offset according to object's position?

I’m building a scene that has many pieces of walls that I connect to each other to create a bigger and more complex wall with doors ans other stuff. I found out how to scale the walls and the texture remains the same, it’s the first step, but I can’t find out how to change the UV coordinates according to each wall’s coordinates on space, so I can have a linear tiled texture over the big wall made of many pieces.

Here you can see a connection from two pieces, it has this texture seam between them that I would like to get rid maybe getting each piece coordinates:

The result would be like, if you move the wall around, the texture remains at the same position, like you had an infinite X and Z texture and the wall piece was the mask to show it.

Thank you for the attention.

map it with world UVs

And how I do that?

TextureCoordinate.x + (WorldPosition.x + WorldPosition.y) * textureWorldScaleHorizontal.
TextureCoordinate.y + WorldPosition.z * textureWorldScaleVertical.

This might work for you if you only have axis aligned walls.

Ok, I could make it for the floor textures, it works perfect, as it’s being projected on the Z Axis. But for the walls, it doesn’t really works. I could change the projection axis for the axis the wall is facing, but then I would need 2 materials each for wall rotation. Isn’t there any way to get projectionss from every axis?

How can I get the textureWorldScaleHorizontal and Vertical? Is it a material node or it’s scripting?

This might be what you’re looking for. You’ll need to use “WorldAlignedTexture” node in the material.

This might be what you’re looking for. You’ll need to use “WorldAlignedTexture” node in the material.

Oh yeah! That’s it! Simple and perfect. And the guy on the video does awesome videos. Thank you all for the help :wink: