Search Unity

Debug.DrawRay/DrawLine ignoring "depthTest" parameter

Discussion in 'Editor & General Support' started by Dreamback, Feb 1, 2019.

  1. Dreamback

    Dreamback

    Joined:
    Jul 29, 2016
    Posts:
    220
    I'm trying to debug many many raycasts coming from the same source by drawing debug lines for each one. I'm calling it like this:

    Debug.DrawLine(source.transform.position, hitpoint, Color.magenta, 1,true);

    The problem is, it's ignoring that "true" at the end - no matter where I move the camera in the SceneView, the debug lines appear in front of everything. And because there are so many lines, it's kinda pointless, I can't see
    where the lines are ending unless they are far away from the source. I have the same problem with Debug.DrawRay.

    Any ideas?
     
    jensschmidt likes this.
  2. Kantic

    Kantic

    Joined:
    Jan 8, 2020
    Posts:
    11
    Same problem, did you find a solutuion?