Unity gMetrix Module 5

Unity gMetrix Module 5

12th Grade

5 Qs

quiz-placeholder

Similar activities

 Unit 4 Advanced AP CSP

Unit 4 Advanced AP CSP

9th - 12th Grade

10 Qs

social engineering

social engineering

1st Grade - Professional Development

10 Qs

Engineering Journals and Proof of Concept Prototype

Engineering Journals and Proof of Concept Prototype

9th - 12th Grade

8 Qs

La importancia del dato

La importancia del dato

1st Grade - University

10 Qs

Google Aptitude Test

Google Aptitude Test

KG - University

10 Qs

CALL: TOEFL Exercise skill 1-3

CALL: TOEFL Exercise skill 1-3

12th Grade

10 Qs

Parcial-Dibujo

Parcial-Dibujo

12th Grade

10 Qs

Chapter 3 Exploring Linux Filesystems

Chapter 3 Exploring Linux Filesystems

11th Grade - University

10 Qs

Unity gMetrix Module 5

Unity gMetrix Module 5

Assessment

Quiz

Computers

12th Grade

Practice Problem

Medium

Created by

Raymundo Martinez

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?