Tips and tricks to debug in Unity:
Anyone else has some wisdom to share?
Tips and tricks to debug in Unity:
Anyone else has some wisdom to share?
Yes, debugging via code
That’s a good article, especially the mentions of Test Driven Design and inspector Debug mode.
I wanted to add that you can use rich text in the console, which allows you to color-code log messages:
Debug.Log("<color=yellow>AI message: Acquiring new target</color>", this);
Debug.Log("<color=cyan>Network message: Lost connection to server</color>", this);
Also: 50 Tips for Working with Unity (Best Practices) – Dev.Mag
This is an older article, but it’s still very valid. The section on Testing and Debugging, such as graphical loggers and HTML loggers, are particularly relevant to this thread.
When in doubt print it out!
This is pretty complete… Debug.Log prints and temporary public inspector variables to save you time.
Two huge ones for me… Keep your LOGS clean!!! Then you can just toss in a print or debug and fined them right away, rather than sift thru 10000 lines to find what your looking for. I had an art teacher that told me once make your change then remove. Works for coding I will copy a line of code rem one out and then make my changes. That way if I mess it up more, need to see what I did last time etc… it is right there. You can all ways remove them later.
I’ve also just started using a asset called rock info… Works great for the fps I’m developing as I can give each bot it’s own channel etc…
Wow, I didn´t know that! Definitively a must when creating Debugging messages for another person
That’s very colourful indeed