Search Unity

[Need Help] Line Renderer Ugly Draw

Discussion in 'Scripting' started by dohaiha930, Jan 16, 2019.

  1. dohaiha930

    dohaiha930

    Joined:
    Mar 27, 2018
    Posts:
    55
    Hi, i'm using line render to draw some simple shape, but it drew ugly line not smooth at all, anyone face this before? How can i fix it?
    I tried Unity 2017 to 2018, still same result as image below.

    - Line with:
    + Same start, end width
    + 5 simple points
    + If try to make distance between points further, this ugly will gone.

    Thanks!

    3.PNG
     
    Last edited: Jan 16, 2019
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    All I can say is: I could reproduce it (with Unity 2018.2.0f2) and it looks like a bug in the line Renderer.

    No Idea if it is possible to fix yourself, if doubling the size of your scene is not an option.
     
  3. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    I don't know your set up but the Y axis is usually height - by having your points at different heights then the line width will vary depending on perspective (if you're looking at it from above). You should probably use X and Z
     
  4. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    I checked it for the axis: it has the same problem... then I moved the camera around and realized that the faces of the line always rotate and stretch to always face the viewport and look like they have a constant size... In your example the line rotates and stretches in a strange way so that it looks wrong.

    Not sure for what you need the line, but if you want to use it in the UI you could go for a different implementation specialized for UI. check this thread.