
Unity - Junior Programmer - Unit 2 review
Quiz by Kelly Herbert
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
If it says, “Hello there!” in the console, what was the code used to create that message?
If you want to destroy an object when its health reaches 0, what code would be best in the blank below?
The code below creates an error that says, “error CS1503: Argument 1: cannot convert from 'UnityEngine.GameObject[]' to 'UnityEngine.Object'”.
What could you do to remove the errors?
Which comment best describes the following code?
If you want to move the character up continuously as the player presses the up arrow, what code would be best in the two blanks below:
Read the documentation from the Unity Scripting API and the code below. Which of the following are possible values for the randomFloat and randomInt variables?
You are trying to randomly spawn objects from an array. However, when your game is running, you see in the console that there was an “error at Assets/Scripts/SpawnManager.cs:5.
IndexOutOfRangeException: Index was outside the bounds of the array.”
Which line of code should you edit in order to resolve this problem and still retain the random object functionality?
If you have made changes to a prefab in the scene and you want to apply those changes to all prefabs, what should you click?

Read the documentation from the Unity Scripting API below. Which of the following is a correct use of the InvokeRepeating method?

You’re trying to create some logic that will tell the user to speed up if they’re going too slow or to slow down if they’re going too fast. How should you arrange the lines of code below to accomplish that?