A 3D object is in 3D… but textures are 2D so when you assign a 2D texture to the 3D model, how does it know how to apply the 2D texture to the 3D model?
Well, similar to how geometry exists in 3D space (XYZ), the coordinates that map a texture to a model also exist in their own coordinate space, typically called “texture coordinates” or “UV coordinates” (and very rarely these days, “UVW coordinates”)
The process of creating UV coordinates is typically called “unwrapping”, in which you split up the model into a bunch of pieces and lay them out flat, and this is used to tell the model which parts of the texture go on which polygon. If you’ve ever seen a papercraft model, it’s pretty much exactly like that.
The important thing here in your case is that the texture coordinates don’t actually care about the size or shape of the polygons in 3D, they only care how they’re mapped in the UV space. So when your geometry gets stretched out the texture will simply stretch with it because as far as it is concerned, the UV coordinates haven’t changed at all even if the geometry has.
There really only two ways to address this, you could adjust the texture coordinates of your mesh in your 3D modeling package… But since texture coordinates are just numbers, you can also change them at runtime using some simply multiplication in the material.
If all you are doing is scaling an object, it is typically best to do this within the material in Unreal. Here’s how that would look:
In order to keep this from affecting ALL of your objects that use this material, you will want to create a material instanceto assign as needed to objects that get stretched out. The much more advanced way to do this would be to create a blueprint actor of your object and use the construction script to create the material instance for the mesh, and then use the objects relative scale in to determine the material parameters XY tiling, that way you don’t have to manually set it every time and you don’t fill your project up with material instances. But I’m already well beyond ELI5 territory here so I won’t go into that.
There are other options, you could use a triplanar projection (which is built into UE4 as a node called WorldAlignedTexture) as ZacD said above which essentially uses world coordinates as texture coordinates, but this typically only works with flat or natural surfaces (rock, dirt, etc.) and not patterned ones (like brick)