Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Custom Gizmo/Handle similar to Off Mesh Links

Discussion in 'Scripting' started by tpennetta, Mar 21, 2014.

  1. tpennetta

    tpennetta

    Joined:
    Jul 25, 2013
    Posts:
    18
    Hi All,

    I am building my own pathfinding algorithm for use within Unity Free and was wondering what the most elegant solution to displaying something similar to Off Mesh Links in the scene view.

    I have tried using the Handles.DrawBezier command with a from empty object to another empty object similar to:

    Code (csharp):
    1. Handles.DrawBezier (jh.transform.position, jh.endTransform.transform.position, Vector3.up, Vector3.down, Color.white, null, width);
    But the tangents seem incorrect, the beziers do not start in the up and end in the down position. I have tried all sorts of variations with bad results. You can see what I am seeing here or in the link to the image below:


    http://i.imgur.com/VKOgPGA.png

    If anyone has a better idea on how to accomplish my goal I would love to hear :)

    But at the same time, why would this code draw such an incorrect bezier curve?

    Thanks!
     
  2. tpennetta

    tpennetta

    Joined:
    Jul 25, 2013
    Posts:
    18
    bumpity
     
unityunity