0
0
Unityframework~10 mins

First Unity project (Hello World scene) - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to display "Hello World" in the Unity console.

Unity
using UnityEngine;

public class HelloWorld : MonoBehaviour
{
    void Start()
    {
        Debug.[1]("Hello World");
    }
}
Drag options to blanks, or click blank then click option'
APrint
BLog
CWrite
DShow
Attempts:
3 left
💡 Hint
Common Mistakes
Using Debug.Print instead of Debug.Log
Trying to use Console.WriteLine which is not used in Unity
2fill in blank
medium

Complete the code to make the GameObject print "Hello World" when the game starts.

Unity
using UnityEngine;

public class HelloWorld : MonoBehaviour
{
    void [1]()
    {
        Debug.Log("Hello World");
    }
}
Drag options to blanks, or click blank then click option'
AStart
BAwake
CUpdate
DOnEnable
Attempts:
3 left
💡 Hint
Common Mistakes
Using Update instead of Start, causing the message to print every frame
Using Awake which runs earlier but is less commonly used for this purpose
3fill in blank
hard

Fix the error in the code to correctly print "Hello World" in the console.

Unity
using UnityEngine;

public class HelloWorld : MonoBehaviour
{
    void Start()
    {
        Debug.Log[1]("Hello World");
    }
}
Drag options to blanks, or click blank then click option'
A< >
B[ ]
C( )
D{ }
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets instead of parentheses for method calls
Using curly braces which are for blocks, not method calls
4fill in blank
hard

Fill both blanks to create a script that prints "Hello World" once when the game starts.

Unity
using UnityEngine;

public class HelloWorld : MonoBehaviour
{
    void [1]()
    {
        Debug.[2]("Hello World");
    }
}
Drag options to blanks, or click blank then click option'
AStart
BLog
CUpdate
DPrint
Attempts:
3 left
💡 Hint
Common Mistakes
Using Update instead of Start, causing repeated prints
Using Debug.Print which is not a Unity method
5fill in blank
hard

Fill all three blanks to create a Unity script that prints "Hello World" when the game starts and uses the correct class and method names.

Unity
using UnityEngine;

public class [1] : MonoBehaviour
{
    void [2]()
    {
        Debug.[3]("Hello World");
    }
}
Drag options to blanks, or click blank then click option'
AHelloWorld
BStart
CLog
DUpdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using Update instead of Start
Using Debug.Print instead of Debug.Log
Mismatching class name and script file name