How can I prevent texture stretching while scaling a mesh?

First one is working correctly, but I need to scale my object in 3d, it only works in 2 directions now. Help, I’m not good at shaders :slight_smile: