---
title: "Quiz: Create with Code 1"
content_type: quiz
url: "https://learn.unity.com/quiz/quiz-create-with-code-1?language=en"
language: en
difficulty: beginner
duration_minutes: 20
question_count: 11
correct_answers_to_pass: 9
unity_version:
  - "6.0"
  - "2022.3"
  - "2021.3"
supported_unity_versions:
  - name: "6.0"
    url: "https://learn.unity.com/quiz/quiz-create-with-code-1.md?language=en&version=6.0"
  - name: "2022.3"
    url: "https://learn.unity.com/quiz/quiz-create-with-code-1.md?language=en&version=2022.3"
  - name: "2021.3"
    url: "https://learn.unity.com/quiz/quiz-create-with-code-1.md?language=en&version=2021.3"
available_languages:
  - name: "en"
    url: "https://learn.unity.com/quiz/quiz-create-with-code-1.md?language=en"
  - name: "es"
    url: "https://learn.unity.com/quiz/prueba-como-crear-con-codigo-1.md?language=es"
  - name: "ja"
    url: "https://learn.unity.com/quiz/quiz-create-with-code-1-jp.md?language=ja"
  - name: "ko"
    url: "https://learn.unity.com/quiz/kwijeu-kodeuro-cangjaghagi-1.md?language=ko"
last_updated: "2026-08-04T14:25:12.000Z"
---

# Quiz: Create with Code 1

This quiz checks your understanding of the concepts from the Create with Code 1 Mission.

This quiz will assess your understanding of the concepts covered in the Create with Code 1 Mission.

## Question 1

What will be the result of the code below?

```csharp
public class Enemy : MonoBehaviour
{
    public Transform ground;

    void Update()
    {
        if (transform.position.y < ground.position.y)
        {
            Destroy(gameObject);
        }
    }
}
```

_Select only one_

- If an enemy goes below the ground, destroy the enemy.
- If the player touches an enemy, destroy the player.
- If an enemy goes above the ground, destroy the enemy.
- If the player goes beneath the ground, destroy the player.

## Question 2

What would be the appropriate line of code to replace the comment below?

```csharp
public float[] values = new float[5];

void Start()
{
 // assign the first element in the array the value of 5.0
}
```

_Select only one_

- float.0 = 5.0f;
- values\[0\] = 5.0f;
- value\[1\] = 5.0f;
- float\[0\] = 5.0f;

## Question 3

Which comment best describes the code below?

```csharp
public class Player : MonoBehaviour
{
  // Comment
  private void OnTriggerEnter(Collider other) {
    if(other.CompareTag("Spike")) {
      Destroy(other.gameObject);
    }
  }
}
```

_Select only one_

- // If the player collides with an enemy, destroy the enemy
- // If the player collides with a spike, destroy the player
- // If the enemy collides with a spike, destroy the enemy
- // If the player collides with a spike, destroy the spike

## Question 4

The image below shows the preferences window that allows you to change which script editing tool (or IDE) you want to use. Where would you click to choose an alternative code editing tool?

![](https://connect-mediagw.unity.com/h1/20201001/learn/images/f43c3bb0-fe63-49bd-96bb-6be68da9e935_Obj_Prog_SCE_2.1.png)

_Select only one_

- Box 1 (External Script Editor)
- Box 2 (Image application)
- Box 3 (Revision control Diff/Merge)

## Question 5

In Visual Studio, “5.0f;” would be underlined with a red squiggly line. When you hover the mouse over the error, what do you think the message would say?

```csharp
int health = 5.0f;
```

_Select only one_

- Cannot complete statement. Remove semicolon.
- The value “f” could not be interpreted for type ‘int’.
- The value 5.0 is out of bounds.
- Cannot implicitly convert type ‘float’ to ‘int’.

## Question 6

Using the information shown in the autocomplete pop-up window below, which of the following would be a valid call of the Instantiate method?

![](https://connect-mediagw.unity.com/h1/20201001/learn/images/b2a0562a-375c-4917-9aa8-e17bfcc66e0c_Obj_Prog_SCE_2.4.png)

_Select only one_

- Instantiate(objectPrefab.transform, spawner, true);
- Instantiate(objectPrefab, spawner, false);
- Instantiate(objectPrefab, spawner.transform, true);
- Instantiate(objectPrefab, spawner, bool);

## Question 7

What would be the code required to produce the debug message shown below?

Hello world.

_Select only one_

- Debug.Log(Hello world.);
- Debug(Log(“Hello world.”));
- Debug(“Hello world.”);
- Debug.Log("Hello world.");

## Question 8

Which of the following is true about either the Start() or Update() functions in a Unity Monobehavior class?

_Select only one_

- The Update() function runs before the Start() function.
- Player input should be handled in the Update() function.
- The Update() function runs only one time.
- The Start() function runs at the start of every Update() function.

## Question 9

In what order do the parts of this script appear?

```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
 public float speed;
 public string playerName;

 void Start()
    {
        playerName = "Test";
    }

 void Update()
    {
        speed++;
    }

}
```

_Select only one_

- functions, class declaration, namespaces, variables
- namespaces, class declaration, variables, functions
- class declaration, namespaces, functions, variables
- variables, namespaces, functions, class declaration

## Question 10

Which of the following lines of code is using standard Unity naming conventions?


1. Public Float Speed = 40.0f;
2. Public float Speed = 40.0f;
3. public float Speed = 40.0f;
4. public float speed = 40.0f;

_Select only one_

- Line 1
- Line 2
- Line 3
- Line 4

## Question 11

Given the inspector shown below, showing variables for “Speed” and “Player Name,” which of the following lines of code would you expect to see in PlayerController.cs?

![](https://connect-mediagw.unity.com/h1/20201002/learn/images/d07bb53c-a982-4574-8e5d-8c05501bc7af_SCE_2.3.png)

_Select only one_

- new Float speed;

  new String playerName;
- float speed;

  string playerName;
- public float speed;

  public string playerName;
- public float Speed;

  public text Player Name;
