Unity Draw Line In Editor

Use unity to build high quality 3d and 2d games deploy them across mobile desktop vr ar.

Unity draw line in editor. To draw a simple line in editor gui you can use handles drawline. Var rect editorguilayout. Active 5 months ago.

I am trying to draw lines in the editor only between two or more points the first point is the gameobject that the script will be attached to the second or more is stored in an array the array stores more markers for ai to move to. Unity unity logos. Editor gizmos should be drawn with gizmos drawline or handles drawline instead.

I ve been trying to use the handle class to draw lines in the editor with no success. Viewed 1k times 2. Of particular note the answer i received made note of additional requirements i had missed.

Thank you for helping us improve the quality of unity documentation. 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 curvature is really small. Kind of separation line.

I use this the 15 value is used to get the line to draw from the both extreme sides of the inspector code csharp. Public class examplescript. How to draw a horizontal line in the inspector like on the reference image.

I ended up asking over at unity answers and i was quickly given a reliable answer from bunny83 including a working example of a custom inspector with custom drawing logic ultimately you can draw lines over a custom inspector using opengl i was just doing it wrong. Monobehaviour void start draw a 5 unit white line from the origin for 2 5 seconds debug drawline vector3 zero new vector3 5 0 0 color white 2 5f. I incresed the value of antialiasing in quality settings and tried different materials but nothing changed.

I ve placed the following script in the assets editor folder. Unity editor horizontal line in inspector.

Source : pinterest.com