Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Handles. Why do they draw through objects?

Discussion in 'Scripting' started by smitchell, Aug 11, 2014.

  1. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    Hey,

    I'm making a little grid based level editor. I'm drawing a grid using Handles.DrawLine () and it draws through everything which is pretty annoying. Makes navigation pretty hard when trying to build on multiple layers

    Is there any way to draw handles that don't appear through objects?

    (Here's a screenshot)

     
  2. TopsyKretts

    TopsyKretts

    Joined:
    Nov 15, 2012
    Posts:
    7
    I'm not sure, but I think handles are always drawn on top of everything else, maybe you could use Line Renderer with a script that is executed in edit mode.
     
  3. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
  4. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    Thanks dude. Yeah debug still showed up through the meshes. Thanks. I'll try the GL + shader idea
     
  5. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Regarding Debug.DrawLine: Make sure the depth test parameter to true.
     
  6. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    Yeah I set it to true. Still rendered through objects.
     
  7. hiiii5

    hiiii5

    Joined:
    Jun 18, 2014
    Posts:
    2
    Marrlie, ShaunFong and adamgryu like this.
  8. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    449
    @Hiiiii5 Thank you so much for the post, that saved my butt. What a great feature.
     
  9. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504