The Art Of Debugging

Over time, every programmer will be faced with countless situations in which they have to figure out “WHY” something is or isn’t performing the actions that are desired. It is in situations like these that proper “Debugging” can save your work and in some cases, your sanity.

To start, there is a simple line of code that can be implemented almost anywhere in your script for use as a triggered identifier.

If you put this line of code in your script, it will type the text that you put in the parenthesis into your Unity Console. With that, you can find where parts of your script are not getting called properly, or even called repeatedly. When you encounter a bug, putting a bunch of Debug.Log statements throughout your script can help you to identify the problem areas.

[Pro Tip]

Before delving too deep into a debug session, it’s always a good idea to toss a copy of your scripts folder onto your desktop or somewhere as a temporary backup just in case things go wrong. Otherwise, you may think a bug to be a quick fix and then find yourself two miles deep without an updated backup to revert to.

--

--

--

Hi, my name is Adam Reed and I am a software engineer specializing in Unity and C# development. Feel free to scroll through and check out some of my work!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Project 1A: Challenging your problem solving skills to accept failure

Docusign: Oauth Flow Outlined

A Simple Python Function

Digital Etch-a-Sketch

CTRL +R control + rethinking of the App. Development World.

VXDIAG VCX C6 For Mercedes Benz DIoP Car Diagnostic Tools SD Connect Diagnosis Auto OBD2 Code…

The Importance of Monitoring Your FOSS Licenses

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Reed

Adam Reed

Hi, my name is Adam Reed and I am a software engineer specializing in Unity and C# development. Feel free to scroll through and check out some of my work!

More from Medium

The Sneaky Capsule: Making a click to move navigation system (Game Dev day 57)

Enemy Hitboxes

Learn to code by making Space Shooter Game