In the Complete Unity Developer Course lecture "How to Ask Good Questions" our instructor, Brice Fernandes, shows us how to develop questions about code errors, so that we can get help quickly. He also shows us how to share our code with others, so that we can get feedback.
First, Brice explains that question developing skills are valuable, because you can use them for solving code errors and problems in everyday life. He explains that developing questions can help you solve problems yourself. In order to improve communication, he also asks us not to use abbreviations, and requests that we write posts with properly punctuated and properly spelled English.
Before we start, let's find out which section of your code is causing the problem. I recently learnt that you can do this by double clicking on each error message in the console tab. Doing this makes MonoDevelop open and highlight the lines of code associated with the error. You can see an example of this in the screenshot shown below.
Brice explains that the error can occur as much as five lines above the highlighted code, so in certain instances, you many need to share a large portion of code or all of your code file. To make it easy for those helping you, always include the line numbers on which the errors occurred. This will show them where to start.
Next, Brice shows us the following procedures, for developing questions to use in discussion posts about code errors:
1) Write the words help or solved in brackets, at the beginning of the titles of your discussion posts:
For example, [Help] Print Command Not Working, or [Solved] Print Command Now Working. Doing this saves time, by letting people know immediately if you need help or not.
2) Describe the Observed Behavior, which is the incorrect behavior that the code unexpectedly did:
For example, when I ran the code, instead of printing the desired text, it gave me an error message. Hint: It helps a lot if you share the entire error message and the error number.
3) Describe the Desired Behavior that the code was supposed to do:
For example, I'm making a console game, which is supposed to print the words "Let the Game Begin!".
4) Include your Unity Version information:
Here's how you find it:
On a Mac click on the Unity menu, at the top of the screen, and select About Unity.
On a PC click on the Help menu and select About Unity.
5) Explain what you've already done in your attempts to solve the problem
For example, I've tried adding a quote to the end of the string, and I'm still getting errors.
6) Copy and Paste the code into the form:
In this case, I will copy and past this code, so that we can look at it and see what is wrong:
print ("Let the Game Begin!")
There are different ways to share your code.
If the problem is confined to 1 or 2 lines of code:
You can post the code to Udemy, in the Discussion area for the Lecture that the coding assignment came from. You can do this by first clicking on the lecture video and then clicking on the discussion bubbles icon, at the Top-Right corner of the screen. Udemy's discussion area isn't formatted for pasting large amounts of code.
For bigger problems, which are contained in more than 2 lines of code:
Please use https://gist.github.com/ or http://pastebin.com/
These sites are made for sharing large amounts of code and allow you to share your code via a small URL, which you can paste into the Udemy Discussion areas.
7) Share all necessary screenshots of Code Errors and Game Malfunctions:
First, click the Play button, at the Top-Center area of the Unity screen. Second, use the Pause button, at the Top-Center of the Unity screen, to freeze the game during the error. Last, take a screenshot of the error. For example, if you have programmed an object to turn different colours and it's staying the same colour, screenshot that.
Last, upload your screenshot:
1). Click on the lecture associated with your programming assignment
2). Click on the Talk Bubbles icon, at the Top-Right of your screen
3). Click the Insert Image icon, at the top of the discussion input form
4). Browse for the screenshot on your computer, and click on it to upload
Congratulations, you submitted your first bug report! Now, you will get help from other programmers!
I have enjoyed talking to you about getting help with coding errors. Remember, don't get discouraged, you are never alone. There are people who are willing to help.
Have an awesome day! Happy programming to all!
Citation of Sources:
The screenshot of the 3D Car, at the beginning of the blog is from: Unity's Standard Asset Example Project, "Car".
About the Author
I'm Elizabeth R. Laurie, and I'm taking the Complete Unity Developer Course, Complete Blender Developer course, and Game Physics course. I love to, learn!
I have always been fascinated with animation and video games, and I plan to use these platforms to make clean, family oriented, entertainment. I also plan to revolutionize education, and make it fun for everyone!