WorksheetsHAFTR - Unity Coding Review
Total questions: 20
Worksheet time: 10mins
What is Unity?
A video game
A game engine
A coding language
3D modeling software
Which window holds a list of your gameObjects within the scene?
Hierarchy Window
Scene Window
Project Window
Inspector Window
Which window shows the properties and components of a given gameObject?
Hierarchy Window
Scene Window
Project Window
Inspector Window
Which of these is NOT a default 3D Object in Unity?
Cube
Capsule
Wedge
Plane
Which colors correspond to the X, Y, and Z axis respectively?
Blue, Green, Red
Red, Blue, Yellow
Green, Blue, Red
Red, Green, Blue
What properties are contained within the 'Transform' component?
Move, Rotate, Scale
Position, Rotation, Scale
Position, Rotation, Size
Move, Rotate, Size
What language does Unity use for scripting?
Python
C++
C#
JavaScript
What two methods are automatically added to our scripts?
OnEnable() & OnDisable
Awake() & Update()
Start() & Update()
Start() & FixedUpdate()
What is the output of this code?
int x = 5;
x = 9;
Debug.Log( x );
5
9
14
Error
What is the output of this code?
Debug.Log( "11" + 8 );
118
19
88
Error
Integers, strings, & booleans are all examples of what?
variables
data types
functions
assets
Which mathematical symbol is used for multiplication?
+
^
%
*
To change a gameObject's position or scale in code, what type of data does it need?
float
variables
Vector2
Vector3
What component do we need to add to a Sphere to make it affected by gravity and physics?
Collider
Rigidbody2D
Rigidbody
A script
When is the FixedUpdate() method called?
Always
Every physics step
Every frame
Never
To check if the player is pressing the Space key, we would write:
Input.GetKey(KeyCode.Space)
Input.GetAxis("Horizontal")
if(spacePressed){}
bool spacePressed = true;
Unity's Prefab system allows us to save a gameObject as an asset to be reusable
True, all components, properties, and children are saved
True, but it cannot be edited later
False, the prefab system only makes clones
False, the prefab system turns assets into gameObjects
Which method creates a gameObject?
Invoke()
InvokeRepeating()
Clone()
Instantiate()
What does this code output?
int a = 1;
int b = 2;
int c = a + b;
Debug.Log( a + c );
1
3
4
Error
Which symbol is used denote a comment?
//
++
--
#
