2
\$\begingroup\$

I see this:

enter image description here

I have a Line Renderer set up like this:

enter image description here

This is the material:

enter image description here

As you can see even if the texture mode is "Tile" the line stretches after the first element of the line. What am I missing?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

Tiling is on as you selected, but you have 1 both on Tiling X and Tiling Y, so the image is displayed once.

You can fix that with a script:

image.tile.x = line.magnitude; // as x/1 = x

This line is kinda pseudocode, just so you can see the logic. If I remember correctly, the X tiling in a line shows how it is repeated along it's length. This line says that the image will be repeated once for every unit the line has. So if you make a line 5 units long, the image will be tiled 5 times.

This code should ideally run once every time the length of the line changes.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks, this helped a lot. Not the texture behavior I expected, but this makes sense too (this way we really have more control). \$\endgroup\$ Commented Apr 15, 2018 at 4:46
4
\$\begingroup\$

I know this thread is old but for anyone who happens to have the same problem, all you need to do is go to the image file itself and set wrap mode from clamp to repeat.

https://forum.unity.com/threads/material-tiling-not-working-correctly.226282/

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .