Is it really so difficult to draw smooth lines in Unity?

后端 未结 6 1002
醉话见心
醉话见心 2021-02-03 10:51

I been trying for a while to draw smooth lines in Unity but with Line Renderer I obtained only jagged lines with the corners not rounded, in particular when the angle of curvatu

6条回答
  •  忘了有多久
    2021-02-03 11:18

    I obtained only jagged lines with the corners not rounded, in particular when the angle of curvature is really small .

    This was a problem in Unity 5.4 and below. This problem has been fixed in Unity 5.5 and above after LineRenderer was completely re-designed.

    All you have to do is update to Unity 5.5 or version above and this problem should go away.

    There is a new variable called LineRenderer.numCornerVertices. You can use that to set how smooth you want the line to be. The value of 5 seems fine for this.

    There is also another new variable called LineRenderer.numCapVertices that can be used to set how smooth the end of the line should be.

    This is a screenshot that demonstrate between 5.4 and 5.5 the changes:

提交回复
热议问题