Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

LineRenderer texture won't tile

Discussion in 'Shaders' started by TheriaGames, May 23, 2021.

  1. TheriaGames

    TheriaGames

    Joined:
    May 23, 2021
    Posts:
    6
    Hi all, apologize if this is the wrong place. I have looked everywhere but can't find anyone else with this problem.

    I am trying to render a line that appears as a series of chevrons, like so:

    arrow_in_line.png

    I've watched two tutorials on this and both times the tutors follow this process:
    1. create a new material with the chosen texture (in my case a purple chevron)
    2. apply the material to the LineRenderer
    3. Switch the Texture Mode to "Tile".

    Ok, fair enough, seems logical. Steps 1 and 2 work fine.
    My problem is, step 3 never seems to work . All I get is the chevron once, followed by a stretched extrusion. Take a look at this;
    crazy_line.PNG

    In this case the chevron is touching the end of the image, so it's "nose" just gets extruded for the length of the line.

    Here are my settings:
    upload_2021-5-22_18-27-42.png

    And here are my material settings:
    upload_2021-5-22_18-28-46.png

    I feel like I've played with every setting possible to make this work. What am I doing wrong here?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    What are the settings on the texture itself? Is imported as a Sprite, or otherwise have the Wrap set to Clamp?
     
    TheriaGames likes this.
  3. TheriaGames

    TheriaGames

    Joined:
    May 23, 2021
    Posts:
    6
    Yes, I imported it as a png sprite.
     
  4. TheriaGames

    TheriaGames

    Joined:
    May 23, 2021
    Posts:
    6
    Ah, I looked at the sprite's settings and found the "wrap mode" and switched it to "repeat". That fixed it.

    Thanks for leading me in the right direction, friend! Also, great avatar :D.
     
    peanutoil and Siliko like this.
  5. ManieBesselaar

    ManieBesselaar

    Joined:
    Nov 1, 2018
    Posts:
    29
    Thanks this solved it for me too