Unity Basics
Unity Advanced
Scripts
Real Scripts
Conditionals
100

The Main Interface Windows in the Unity Editor(5)

Scene/Game View. Scene Hierarchy. Inspector Window. Project Files. 

100

______ defines the behavior and properties of a Game Object.

(Hint: In Inspector window)

What are Components. 

100

Oh no! I’m getting an error after pasting the script. It says the script cannot be found. 

What could be the prime cause of this? 

What is… 

The name of the script does NOT match the name next to MonoBehavior.

100

How do I access the rigidbody of an object in C#? 

“rb = __________” 

What is

rb = GetComponent<Rigidbody>(); 

100

What are conditionals (if statements) used for?

Conditionals are used to make decisions in your code.

200

Basic Objects in Unity is called

Game Objects

200

What do we use to determine the boundaries of a Game Object in our game

What are Colliders? 

200

What are the different types of variables we’ve worked with in C#? 

What is...

Int, String And Bool. 

200

How would we write a movement script in the horizontal axis (A,D and arrow keys: left, right)

float moveHorizontal = _____________;

(Hint: we’re using unity’s keyword library instead of grabbing individual keys). 



float moveHorizontal = Input.GetAxis(“Horizontal”); 

200

What is the correct syntax (structure) of a conditional (if statement)?

if (condition) {

//code to execute if the condition is true

}

300

How can we implement physics into our game? 

Using Rigidbody and Colliders. 

300

Name at least 3 different colliders we attach to our game objects. 

Box, Sphere, Capsule, Mesh Collider, Terrain Collider. 

300

What is the difference between a Start() and an Update() method? 

What is… 

Start() methods only occurs at the beginning of the program.
Update() continues checking throughout the program. 

300

private bool name = Physics.Raycast(transform.position, Vector3.down, 1.1f, groundLayer);

What does this line of code do? We’ve used this before. 

What is isGrounded(); 

Checking for ground layer to make sure there is no second jump. 

300

What is the output of this code?

int playerScore = 10;

if (playerScore > 5) {

    Debug.Log("Player is doing well!");

}

Player is doing well!

400

What are prefabs? How can we create a prefab? 

Prefabs are pre-configured templates of Game Objects that we can reuse anytime. 

Creating a Prefab requires dragging the finished gameobject into your project files window. (Usually into your prefab folder)

400

My player has rigidbody attached but when I press play, my player is stuck in midair without any movement. 

What could be the problem? 

What is unchecking isKinematic, and isGravity? 

400

What are the three values that a Vector3 intakes? 

Bonus points to write out a new Vector3 variable. 

What is (x, y, z)? 

Vector3 Position = new Vector3(0, 0, 0)

400
Give me an If statement that tests if player's hp is greater than 50, we make his speed 30.0f. 


float int hp = 100.0f; 

float int speed = 10.0f; 

if (hp > 50)

{

speed = 30.0f; 

}

400

What is the output of the following code?

int playerHealth = 80;

if (playerHealth <= 20) {

    Debug.Log("Player is critically injured.");

} else if (playerHealth <= 50) {

    Debug.Log("Player is moderately injured.");

} else {

    Debug.Log("Player is in good health.");

}

Player is in good health.

500

In our Unity Inspector Window, we can apply a _____ to keep certain game objects in categories. 

Allows us to target specific categories to act in a certain way inside of our script. 

(Hint: we used this to collect coins) 


What are tags? 


500

How can we use scripts to access real time properties of a Game Object in the inspector window? 

What are Public Variables? 

500

I want to detect collision between my player and an item on the screen.
What methods would we use to detect collision? 


What is …

OnCollisionEnter or 

OnTriggerEnter

500

How do we write a for loop? 

I want it to Debug.Log("hello world") ten times. 

for (int i = 0; i < 10; i++)

{

 Debug.Log("hello world");

}

500

What's the output of the following code?

int playerHealth = 50;

if (playerHealth <= 20) {

    Debug.Log("Player is critically injured.");

} else if (playerHealth <= 50) {

    Debug.Log("Player is moderately injured.");

} else {

    Debug.Log("Player is in good health.");

}

Player is moderately injured.

M
e
n
u