Search Unity

Line renderer question

Discussion in 'General Graphics' started by kirilli, May 1, 2019.

  1. kirilli

    kirilli

    Joined:
    Mar 5, 2019
    Posts:
    30
    Is there a way to lock the line renderer to always try to orient in a certain way.

    I've setup some flags and it looks good from one side, the flags are pointing down but when viewed from the other they all point up.

    Works great for ropes and cables and chains thou.

    upload_2019-5-1_14-10-4.png

    Thank you!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,325
    Try changing the alignment property of the line renderer.
     
  3. kirilli

    kirilli

    Joined:
    Mar 5, 2019
    Posts:
    30
    Now with the flags are properly orienting A! I've setup a vertex offset material to wave the flags in the wind but the rope ends now also separate from the anchors B. What is the best way to lock those in place?

    upload_2019-5-1_15-50-29.png
    Maybe using the line renderer color settings (not sure if those generate vertex colors) as a mask in the vertex offset shader?
    upload_2019-5-1_15-49-42.png
     

    Attached Files:

  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    6,740
    Yes, they modify the vertex colors.
     
    karl_jones likes this.
  5. kirilli

    kirilli

    Joined:
    Mar 5, 2019
    Posts:
    30
    That worked, rope is locked at the anchors, thank you all!
     
    richardkettlewell and karl_jones like this.