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
2
Question by MD_Reptile · Dec 02, 2012 at 07:25 PM · waypointcurvesplinedrawline

draw curved line between waypoints - like ongizmodrawline?

In the editor, I want to draw curved connections between waypoints, like a spline I suppose but does not need to be exact for an ai to follow, just a visual representation while editing, the AI will just go from waypoint to waypoint in code, but how can I just create the appearance of a curved line in the editor scene window? For the time being I am just using extra waypoints in between with ongizmodraw() lines between them.

Im thinking an empty with a script that has two transforms, and just draws a curved (maybe lerped? bezier?) line between them.

Like this:

http://imageshack.us/a/img28/7656/curvedlineunityanswers.png

Things I have tried and didnt work for me yet:

http://www.frictionpointstudios.com/blog/2010/5/20/updated-unity-bezier-curve-now-in-easy-to-use-prefab-form.html

And that seems nice, but pops tons of warning in the editor and doesnt draw correctly :/

another thing I found:

http://forum.unity3d.com/threads/30826-What-s-wrong-with-this-code

Check "Andeeeee"s post - problem here is I don't know JS like I do C# so this will be challenging to understand for me...because I cant get it converted to C#...

Neither of those would work properly for me. Anyone have a better idea for me?

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

2 Replies

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

Answer by MD_Reptile · Dec 04, 2012 at 05:47 PM

Ok sort of kind of solved this with SWS (Simple Waypoint System) which is awesome. I mean I went from barely getting a couple few waypoints by hand a minute, to several waypoints, with smooth curves between EASILY and I am working on getting switched completely over to this system of waypoints, and working off that from now on.

And umm, another way I found was by using the scripts I found here:

http://www.frictionpointstudios.com/blog/2010/5/20/updated-unity-bezier-curve-now-in-easy-to-use-prefab-form.html

And I had to change the actual PNG files to have bigger canvas because they were smaller than 8x8, so made all three 11x11 to be on the safe side, now it works! pops tons of warnings still but does work. It was not good enough for my purposes, so I opted for the SWS in the asset store, and it fits my needs well.

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
2

Answer by Graham-Dunnett · Dec 04, 2012 at 04:14 PM

I'd start with the example here:

http://docs.unity3d.com/Documentation/ScriptReference/Handles.DrawBezier.html

In your case, the problem will be knowing what the normals need to be.

Comment
Add comment · Show 1 · 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 MD_Reptile · Dec 04, 2012 at 04:39 PM 0
Share

@GrahamDunnett I saw that stuff but had assumed it only was for 2d bezier like on top of a gui and things like that - rather than a 3d bezier in the editor view.... Was i mistaken? I will look into this though, hopefully I come up with a better solution than the answer I posted, thanks for your input

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

How to make objects running by Curve? 0 Answers

Keep object on rail? 1 Answer

importing spline curves from maya to unity? 1 Answer

Recommendations for a script/plugin for creating set, curved paths 2 Answers

iTween and 2D Platforming Tutorial Merge: Rotation of player and camera needed 1 Answer


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