Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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
  8. 8bitgoose

    8bitgoose

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