Unity Community


Results 1 to 9 of 9

Thread: Debugging help


  1. Posts
    67

    Debugging help

    Hi all im new to coding so I don't know much. I been coding maybe 3 weeks now I learn some things. I am learning by myself. On my own time and I dont know much about debugging. How does it really help. How can I use it and I think this is the right place to place this thread. if you got any ideas on how to help me plz post. If you got any tips that be great to and no negative comments im new sorry if this is a stupid question.
    Last edited by pitso; 05-26-2012 at 06:19 PM.


  2. Posts
    439
    The debugger is the obnoxious little box that pops up whenever there is an error in your code. It is handy in the way that it runs through your code, looks for unused references, syntax errors and other shenanigans your brain tried to feed you.

    The process of debugging is simply getting rid of those bugs, or fixing functions when they don't work as you intended them to. A real-life example of debugging is, for example, fixing a PC. You check all the components, run various checking software (debuggers) and act accordingly.

    The best way you can use it is to actually read and understand it. Most of the time, the debugger tells you in plain English what is wrong and what you should change. Sadly to say, some users don't do that, post their error messages and get ridiculed or receive a translation from English to English of what Unity is trying to say.

    Not to say that coming here with a problem is wrong -- especially if you are stumped on a problem. Just make sure you read what the debugger threw at ya, and google all the words and definitions you don't understand. 95% of the time you can fix things on your own, and the errors are trivial (mis-matched types, illegitimate casting, missing components or variables).

    Good luck!
    Looking for helpfull hands with an action/RPG fan game -- link
    Remember to have a nice day and smile!


  3. Location
    Argentina
    Posts
    83
    The debugger is the obnoxious little box that pops up whenever there is an error in your code. It is handy in the way that it runs through your code, looks for unused references, syntax errors and other shenanigans your brain tried to feed you.

    The process of debugging is simply getting rid of those bugs, or fixing functions when they don't work as you intended them to. A real-life example of debugging is, for example, fixing a PC. You check all the components, run various checking software (debuggers) and act accordingly.

    The best way you can use it is to actually read and understand it. Most of the time, the debugger tells you in plain English what is wrong and what you should change. Sadly to say, some users don't do that, post their error messages and get ridiculed or receive a translation from English to English of what Unity is trying to say.

    Not to say that coming here with a problem is wrong -- especially if you are stumped on a problem. Just make sure you read what the debugger threw at ya, and google all the words and definitions you don't understand. 95% of the time you can fix things on your own, and the errors are trivial (mis-matched types, illegitimate casting, missing components or variables).

    Good luck!
    That's not a debugger. That's just the Console window.
    As Zethariel said, console window shows you errors (and wanings) and it's useful to fix bugs, but it's still not a debugger.

    A debugger is a tool that lets you to stop (and continue) the flow of the code, and inspect the variables' values when you stop the program.
    This tool is available inside MonoDevelop (you have to attach MonoDevelop to unity, using the attach button), place your breakpoints where you want, and tun the game (from unity)


  4. Posts
    67
    how can i use the debugger and ya i know how to use the console window 50% of the time i can fix my problems it just takes time


  5. Location
    Argentina
    Posts
    83
    -Go to MonoDevelop (and be sure to have the unity project open)

    -Run/AttachToPrecess -> and select " Unity Editor (Unity) "

    -Put breakpoints where you want.

    -Run the game from unity.


  6. Posts
    145
    To iterate slightly on the above;

    When you reach a breakpoint in the code, execution will stop. What this essentially allows you to do is to check the 'state' of your script at that point in time; what values do variables hold, and such.


  7. Posts
    67
    lol how do i add breakpoints


  8. Posts
    145
    Click the left mouse button on the line where you want to set one (actually, slightly to the left of where line-numbers appear).


  9. Posts
    67
    i tryed it didn't work its with the red cycles right on the left when you do everything it says breakpoints

Posting Permissions

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