Unity gMetrix Module 5

Unity gMetrix Module 5

12th Grade

5 Qs

quiz-placeholder

Similar activities

Python L1 Quiz 8: Designing Programs

Python L1 Quiz 8: Designing Programs

1st - 12th Grade

10 Qs

MIT App Inventor and if else conditionQ uiz

MIT App Inventor and if else conditionQ uiz

5th Grade - University

8 Qs

Computer Basics

Computer Basics

11th - 12th Grade

10 Qs

Pengolahan File dan Input Output

Pengolahan File dan Input Output

12th Grade

10 Qs

Intro to Python

Intro to Python

KG - University

10 Qs

Hardware

Hardware

9th - 12th Grade

10 Qs

Python Basics

Python Basics

6th - 12th Grade

9 Qs

Unreal Engine - Blueprinting

Unreal Engine - Blueprinting

12th Grade

10 Qs

Unity gMetrix Module 5

Unity gMetrix Module 5

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Raymundo Martinez

Used 1+ times

FREE Resource

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.