Unity gMetrix Module 5
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Raymundo Martinez
Used 1+ times
FREE Resource
Enhance your content in a minute
5 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
5 mins • 1 pt
Which of the following components do you need to properly set up physics based on a 2D Player character? (Choose two)
Rigidbody2D
Rigidbody
Trigger
2D Collider
Answer explanation
With only a Rigidbody2D and a 2D type collider, you can set up a physics-based 2D GameObject.
2.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
A programmer created the code below to read input from the user and make the character jump when the Space key on the keyboard is pressed. The problem is that the character flies too high when the user presses the key. What is causing this issue?
bool fly;
void Update(){
if(Input.GetKey(Keycode.Space)){
fly = true;
}
}
void FixedUpdate(){
if(fly){
fly = false;
rb.AddForce(Vector3.up, ForceMode. Impulse);
}
}
Rigidbody mass is too low.
GetKey gets called every frame the key is pressed.
Input reading must be done on FixedUpdate.
Force should be multiplied by Time.deltaTime.
Answer explanation
In this case, the issue is that GetKey gets called every frame the key is pressed. To fix the issue, GetKey should be replaced by GetKeyDown to work only on the first frame
the key gets pressed.
3.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
The following code is assigning a vector to the player's transform position. What behaviour will this cause on the player GameObject? Vector2 customVector; void Start(){ customVector = -Vector3.up; } void Update(){ transform.position += customVector; }
Moves the player to the right
Moves the player forward
Moves the player to the left
Moves the player down
Answer explanation
It will move the player down because a negative version of Vector2.up is equal to Vector2.down.
4.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Select the proper combination of code snippets that will create a valid method that reads Input from the player: 1:{ 2: void ReadInputFromPlayer( 3: Input.GetKeyDown(KeyCode.W)(){ 4:} 5: if(Input.GetKeyDown(KeyCode.W)){
1, 2, 3, 4
2, 4, 2, 3
2, 1, 3, 4
2, 1, 5, 4
Answer explanation
2, 1, 5, 4 is the only combination that has the proper order and condition to ask for input.
5.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Select the combination of code snippets that will properly declare a variable not accessible from another script but available in the Inspector.
1: power = 1;
2: [SerializeField]
3: public
4: private
5: int
6: static
3, 6, 5, 1
2, 3, 5, 1
4, 6, 5, 1
2, 4, 5, 1
Answer explanation
When you need to have a variable available in the Inspector but keep it private, the proper way is to use a combination of private access modifier and the [SerializeField]
attribute, so 2, 4, 5, 1 is the correct order.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Identify the type of keywords
Quiz
•
9th - 12th Grade
10 questions
remidieal tpav
Quiz
•
12th Grade
10 questions
U07 D1 Mobile App Design & Implementation
Quiz
•
12th Grade
10 questions
ICT as Platform for Change
Quiz
•
11th - 12th Grade
10 questions
emtech
Quiz
•
12th Grade
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
8 questions
Basic computer
Quiz
•
9th - 12th Grade
10 questions
Cap Cut
Quiz
•
12th Grade
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Computers
8 questions
2 Step Word Problems
Quiz
•
KG - University
10 questions
Martin Luther King, Jr. For Kids
Interactive video
•
1st - 12th Grade
10 questions
Dr. King's Speech and Its Impact
Interactive video
•
7th - 12th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
7 questions
Anti-Bullying ARS 15-341
Quiz
•
9th - 12th Grade
13 questions
Model Exponential Growth and Decay Scenarios
Quiz
•
9th - 12th Grade
15 questions
TSI Math Practice Questions
Quiz
•
8th - 12th Grade
24 questions
Identify Properties of Polygons and Quadrilaterals
Quiz
•
9th - 12th Grade
