Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Befall · May 23, 2012 at 01:10 AM · linefreedrawline

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.

Comment
Add comment · Show 10
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · May 23, 2012 at 01:53 AM 1
Share

But Vectrosity is awesome. ;) The GL class should work though; try using a different material.

avatar image Befall · May 23, 2012 at 01:58 AM 0
Share

Is there a specific shader I need to use? Nothing seems to help.

avatar image Eric5h5 · May 23, 2012 at 02:11 AM 0
Share

Did you try VectorLine on the wiki?

avatar image Befall · May 23, 2012 at 03:19 AM 0
Share

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.

avatar image Befall · May 23, 2012 at 03:40 AM 0
Share

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

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Eric5h5 · May 23, 2012 at 04:01 AM

You can use VectorLine from the wiki.

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Befall · May 23, 2012 at 04:02 AM 1
Share

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!

avatar image Eric5h5 · May 23, 2012 at 04:04 AM 1
Share

That's what a wiki is for. :)

avatar image XienDev · Mar 20, 2013 at 09:13 AM 0
Share

If you have unity free, and your version is less then 4.0, you can use http://wiki.unity3d.com/index.php?title=DrawLine

avatar image michael_house · Feb 16, 2015 at 12:35 AM 0
Share

Link dead, a good reason why link only answers are awful.

avatar image michael_house · May 01, 2015 at 03:25 AM 1
Share

How about you search and update your answer?

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges