Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2004
    Location
    USA
    Posts
    1,529

    Question Debug.Drawline not drawing?

    I am on class VTM 9, and I got to where Lee creates the Debug lines for the triangle, only it doesn't draw anything for me. Unless it has drawn the lines in the same blue as the background for some reason, although I doubt that because Lee's lines look white. What did I do wrong.


    In TerrainPatch

    Code:
    public void DrawGrid()
            {
                Debug.DrawLine(Vertices[0], Vertices[Size]);
                Debug.DrawLine(Vertices[Size], Vertices[Size + 1]);
                Debug.DrawLine(Vertices[Size + 1], Vertices[0]);
            }

    In TerrainDemo

    Code:
    public void Update()
            {
                patch.DrawGrid();
            }

    can anyone help?

  2. #2
    Join Date
    Dec 2002
    Location
    Virginia Beach, VA
    Posts
    861
    Are you looking at the Game view or the Scene view. Debug.DrawLine lines are only viewable in the Scene view. You'll also want to make sure that you are framed up on the terrain patch.

  3. #3
    Join Date
    Jan 2011
    Location
    Blackpool, UK
    Posts
    853
    Quote Originally Posted by chronos78 View Post
    Are you looking at the Game view or the Scene view. Debug.DrawLine lines are only viewable in the Scene view. You'll also want to make sure that you are framed up on the terrain patch.
    Won't it also be visible in the game view if you have Gizmos enabled? (Haven't tested which is why it's a question )

  4. #4
    Join Date
    Dec 2002
    Location
    Virginia Beach, VA
    Posts
    861
    Quote Originally Posted by darkmobius View Post
    Won't it also be visible in the game view if you have Gizmos enabled? (Haven't tested which is why it's a question )
    No clue either, never tried it.

    Update: Yup it works.

  5. #5
    Join Date
    Jul 2006
    Location
    San Diego, CA, USA
    Posts
    897
    Learned another something new. Gizmos enabled.

  6. #6
    Join Date
    Jul 2005
    Location
    Scotland
    Posts
    962
    thanks for the Gizmos tip darkmobius

  7. #7
    Join Date
    Sep 2004
    Location
    USA
    Posts
    1,529
    I don't know what you mean when you say the scene view, Lee. I guess I was looking at it in the game view because I pressed play, but I don't know how or what the scene view is. However, the Gizmos button did work for me. But I would would still very much like to know how to do this while looking in the scene view.


    If anyone doesn't know where the Gizmos button is, it is the button on the right of the "Maximize on Play" button on the top of the viewer. On the right side.

  8. #8
    Join Date
    Sep 2004
    Location
    USA
    Posts
    1,529

    Lightbulb

    Alright I get it now. I didn't realize that you could click the tab to get back to scene view while you have hit play. I thought you had to be in game view while in play. I probably saw Lee do it in the Unity fundamentals and just forgot about it. Anyway, I am good now, and it looks like my question made others learn something, and that is pretty cool.

  9. #9
    Join Date
    Jan 2011
    Location
    Blackpool, UK
    Posts
    853
    Quote Originally Posted by Wolfknightly View Post
    Alright I get it now. I didn't realize that you could click the tab to get back to scene view while you have hit play. I thought you had to be in game view while in play. I probably saw Lee do it in the Unity fundamentals and just forgot about it. Anyway, I am good now, and it looks like my question made others learn something, and that is pretty cool.
    Just as important to learn from everyone else's experiences. That way we all get better.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •