- Home /
Free simple 2D line rendering?
Hey all,
I know this has been asked a few times, but I've seemingly exhausted all options.
The Drawing.DrawLine() function from the forums has issues on PCs apparently, and according to the forum posts that hasn't been fixed; not that I could find, anyway. I messed with the code a bit and couldn't figure out an answer.
As I'm using Pro, I have the option for the GL class, but even directly copying code and testing it on my machine has yielded no results.
Lastly, LineRenderer is simply too much unneeded overhead when I simply need 2D orthographic line graphics projected, not lines in 3D space.
The only other option I've seen is Vetrosity, but that's $25 I'd rather not spend since these lines are a simple, minor part of my project.
Does anyone have a solution for me? I can provide code of what's not working and further explanation of problems if need be.
But Vectrosity is awesome. ;) The GL class should work though; try using a different material.
Is there a specific shader I need to use? Nothing seems to help.
Ooh, that looks fun. Nice job. :) I'm using C# so I might try and copy it over to that and work in my project with it. Will update you if it works. Thanks for the link.
Still just getting nothing. No errors, no lines either. Just trying to make a single line from center of screen to mouse. See any issues? http://codepaste.net/zssu3c
Answer by Eric5h5 · May 23, 2012 at 04:01 AM
You can use VectorLine from the wiki.
Thanks again for the help! Since I tested and confirmed the utility of the C# version, I added that to the wiki page. Hope you don't $$anonymous$$d!
If you have unity free, and your version is less then 4.0, you can use http://wiki.unity3d.com/index.php?title=DrawLine
Link dead, a good reason why link only answers are awful.
Your answer

Follow this Question
Related Questions
How to draw a line in unity3d 3 Answers
Handles.DrawLine refresh rate in scene view 1 Answer
Color Handles.DrawLine 1 Answer
Draw line with TrailRenderer 0 Answers
Gizmos.DrawLine - thickens? 5 Answers