Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Krshojestic · Aug 13, 2012 at 04:12 PM · linerendererdrawline

Draw a round-shaped line

Hi folks,

I'm making a simple game in Unity where the main gameplay is as simple as connecting certain points by drawing straight lines between each of them. I'm a newbie in Unity, but I'm fairly experienced in Action script 3. I've looked for ways to draw lines between points, which is extremely simple in AS3, but it seems way more complicated in Unity. Thus far I've chosen to use LineRenderer to draw multiple lines from one point to another. The line between the first two points looks perfect, but the problem is that when the second line is being drawn, the first one bends out of shape. Now, I'm perfectly aware why that happens: By default, the lines are flat and that's why they bend when the following line is "rerouted" in another direction. In order to prevent this unwanted bending effect, I think I'm going to need a rounded line. The problem is I don't have a clue how to do that. I'm accepting any solution including or excluding LineRenderer, as far as it resolves my problem for a nice and smooth way to draw lines between points.

Thanks.

Comment
Add comment · Show 2
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 Krshojestic · Aug 13, 2012 at 11:09 AM 0
Share

I forgot to add that I'm working in C#

avatar image TheVectorHunter · Aug 13, 2012 at 04:54 PM 0
Share

Lines can't be round they are a connection between two vertices.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Screenhog · Aug 13, 2012 at 05:02 PM

Could you show a screenshot or two of what's happening? I'm having difficulty visualizing this, especially since my experience with LineRenderer has resulted in nothing but straight lines.

I'd also recommend checking the Unity Asset Store. There's a fairly highly-rated product called Vectrosity that might be exactly what you need.

Comment
Add comment · 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
0

Answer by DESTRUKTORR · Aug 13, 2012 at 05:05 PM

I believe what he means is he wants it to create a curve. What I'm assuming he's saying is happening is that it is creating a sharp angle (or "corner"), generating a single angle from the first point to the second to the third, whereas he wants it to smooth out into a curve shape.

I wouldn't know the exact implications of increasing the vertex count (dynamically) to make it a semi-smooth curve, but I wouldn't suggest trying it. It sounds like it would just lock up, even with only three points.

I would suggest you look at this tutorial.

Comment
Add comment · 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
0

Answer by Krshojestic · Aug 13, 2012 at 06:22 PM

Thank you for the response, this was my problem actually: http://answers.unity3d.com/questions/64716/can-i-render-nice-thick-lines-with-linerenderer-wi.html

This topic can be deleted.

Comment
Add comment · 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

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

11 People are following this question.

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

Related Questions

Draw a line with collision 2 Answers

Draw line in runtime 1 Answer

How should I do to draw lines like this? 0 Answers

How do I draw lines in a Rect 1 Answer

Drawing lines from mouse position 2 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