Search Unity

Bezier Curve Render issue with Terrain

Discussion in 'Scripting' started by Tiki, Oct 6, 2015.

  1. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    For some reason when I'm trying to set a handles.drawbezier* function from one node to another (a couple of elongated cube prefabs), it only renders the curve when I'm underneath the terrain the two nodes are placed on top of, but the line is most definitely spawning *above* the terrain. When viewing from above the terrain, there is nothing.

    Above:
    above.jpg
    Below:
    below.jpg
     
    Last edited: Oct 6, 2015
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    When are you drawing this - in OnDrawGizmos or what? It looks like the bezier is simply being drawn before the terrain is being drawn.
     
  3. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    Oh, I hadn't thought of it that way. I'll try it with OnDrawGizmos. It's being run in OnSceneGUI right now.
     
  4. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    Yup, confirmed. Thanks StarManta.