BELL RINGER: Unity C# Review 1

BELL RINGER: Unity C# Review 1

10th Grade

5 Qs

quiz-placeholder

Similar activities

Quiz Lec2

Quiz Lec2

KG - University

10 Qs

CAT G10 M19 AMA Session 1 Quiz

CAT G10 M19 AMA Session 1 Quiz

10th Grade

10 Qs

Database Concept

Database Concept

9th - 12th Grade

10 Qs

Basic Parts of Speech EPS

Basic Parts of Speech EPS

9th - 10th Grade

10 Qs

PUNCTUATION SPACING RULES

PUNCTUATION SPACING RULES

9th - 12th Grade

10 Qs

OCR GCSE CS - 2.1 ERL sorts and searches

OCR GCSE CS - 2.1 ERL sorts and searches

10th - 11th Grade

9 Qs

E-Waste & Climate Tech Quiz

E-Waste & Climate Tech Quiz

10th Grade

10 Qs

Instrumen Soal Computational Thinking

Instrumen Soal Computational Thinking

10th Grade

10 Qs

BELL RINGER: Unity C# Review 1

BELL RINGER: Unity C# Review 1

Assessment

Quiz

Computers

10th Grade

Practice Problem

Medium

Created by

JASON SAMMONS

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 CHOICE QUESTION

30 sec • 3 pts

Media Image

You are trying to STOP spawning enemies when the player has died and have created the two scripts below to do that. However, there is an error on the underlined code, “isAlive” in the EnemySpawner script. What is causing that error?

The “p” should be capitalized in “playerController.isAlive”

The “bool” in the PlayerController class needs a “public” access modifier

The if-statement cannot be in the Update method

“isAlive” must start with a capital “I” (“IsAlive”)

2.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

In your game, you want to increase the player's health by 10 points when they pick up a health pack. You've written the following line in your script, but it's not working: playerHealth =+ 10;. What is the correct way to write this line?

playerHealth =+ 10;

playerHealth += 10;

playerHealth = 10+;

playerHealth +== 10;

3.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

To create a more dynamic game, you decide to randomly generate the color of an object at the start of the game. Which of the following code snippets correctly changes the object's color to a random color?

gameObject.GetComponent().material.color = Random.Color();

gameObject.GetComponent().material.color = new Color(Random.value, Random.value, Random.value);

gameObject.GetComponent().material.color = Color.Random();

gameObject.GetComponent().material.color = Color(new Random.value, new Random.value, new Random.value);

4.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

Media Image

When you run a project with the code below, you get the following error: “NullReferenceException: Object reference not set to an instance of an object.” What is most likely the problem?


The Player object does not have a collider

The Enemy object does not have a Rigidbody component

The “Start” method should actually be “Update”

There is no object named “Player” in the scene

5.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

Media Image

Which of these is the correct way to get a reference to an AudioSource component on a GameObject?

Select image to expand

Line A

Line B

Line C

Line D