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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Looking for a solution to animate a line along its direction

Discussion in 'Scripting' started by sebastianp_big, Oct 3, 2017.

  1. sebastianp_big

    sebastianp_big

    Joined:
    Oct 1, 2015
    Posts:
    6
    Hello!

    I am currently working on a project where i have to show different data flows using the line-renderer. I am searching for a performant way to visualize the direction the flow is flowing :)

    The most basic way, modifying the offset of a texture leaves a lot to be desired. It does not look good if the flow line drastically changes directions and it only moves in the same direction everywhere on the line.

    What i would love to see is either a texture moved along the line, so it changes the direction as the line changes direction or some sort of vertex animation in the direction the line goes...

    I tried a few things with a surface shader but it seems like i can not easily get the directio of the line.

    Do you guys have any ideas what i could try?

    Thanks!
     
  2. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,078
  3. sebastianp_big

    sebastianp_big

    Joined:
    Oct 1, 2015
    Posts:
    6
    Thanks for the hint but it does not look like it can do what i want. I do not want to animate the creation of the line. I want to visualize the flow in the direction of the line. So the line is already there and i want some kind of effect so the viewer can see from where to where the flow is going. Like a top down view of a river...
     
  4. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,078
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,022
    Last edited: Nov 2, 2018
  6. sebastianp_big

    sebastianp_big

    Joined:
    Oct 1, 2015
    Posts:
    6
    @mgear you my friend deserve a medal. That is exactly what i was looking for and to be honest, i learned how to do that in university a few years back but my brain just did not come up with that solution... :)
     
    Last edited: Oct 6, 2017
    omayunay likes this.