I need to tile the left part of a texture x number of times based on the length of a plane. At the far right end of the plane, the right side of the texture should be visible. This picture explains my problem:
I figure it has something to do with MainTextureScale and MainTextureOffset, but I can’t quite figure out how to calculate their values:-)
That’s not really possible. Auto tiling/repeating of a texture only works for the whole texture. Texture coordinates are linearly interpolated between vertices, so if you want to have a part of the plane behave differently you need another pair of vertices at the cut between those two parts. The best thing you can so with one texture and one mesh is that you have your right end fixed and the left part streched but you need a plane with 6 vertices and 4 tris.