Different Sized/Scaled Boxes/Planes/Etc. Won't work with Repeating Materials

I have a problem…

So I have a project that has walls(boxes) and the ground(planes). I need a material that repeats and won’t stretch If i have different sized walls.

Let’s say I have a box which has a face that is 2x1 and i want the texture to repeat 2x1 as well, but what if another face is 3x1? It’ll look stretched which is not what I want. I could use planes as each face of the wall but that might get costly with the amount of materials (each face) I would have to make.

Maybe there’s a way to do it with coding, but I’m a beginner so I don’t know much.

I did find an example that works but the project was deleted. (gif from example)
uv

If anyone knows anything that might be close to what I’m looking for, PLZ share :slight_smile:

Here is the project in which I need it for: project

I found the project that the person asking the original question lists as their solution:

https://playcanvas.com/project/795112/overview/uv-testii-solved

That should be a good starting point.

I hope this his helpful.

1 Like

Thanks for the reply, I’ll look into it.

I took a look and I can’t read the code. Although, I think I can just have a lot of materials and planes…