Challenge - 5 Problems
Scene Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this scene loading code?
Consider the following Unity C# code snippet that loads a scene asynchronously. What will be printed in the console when the scene finishes loading?
Unity
using UnityEngine; using UnityEngine.SceneManagement; public class SceneLoader : MonoBehaviour { void Start() { StartCoroutine(LoadYourAsyncScene()); } System.Collections.IEnumerator LoadYourAsyncScene() { AsyncOperation asyncLoad = SceneManager.LoadSceneAsync("Level2"); while (!asyncLoad.isDone) { yield return null; } Debug.Log("Scene Loaded"); } }
Attempts:
2 left
💡 Hint
Look at when Debug.Log is called in relation to the async loading completion.
✗ Incorrect
The Debug.Log("Scene Loaded") is called after the asyncLoad.isDone becomes true, meaning the scene finished loading.
🧠 Conceptual
intermediate1:30remaining
Which method unloads a scene in Unity?
You want to remove a scene from memory in Unity during runtime. Which method should you use?
Attempts:
2 left
💡 Hint
Think about the method that removes a scene asynchronously.
✗ Incorrect
SceneManager.UnloadSceneAsync unloads the specified scene asynchronously, freeing memory.
🔧 Debug
advanced2:00remaining
Why does this scene not unload properly?
This code tries to unload a scene but the scene remains loaded. What is the likely cause?
Unity
using UnityEngine.SceneManagement;
void UnloadScene()
{
SceneManager.UnloadSceneAsync("GameScene");
}Attempts:
2 left
💡 Hint
Check if the active scene can be unloaded.
✗ Incorrect
Unity does not allow unloading the active scene. You must set another scene active before unloading.
📝 Syntax
advanced1:30remaining
Which code correctly loads a scene additively?
You want to load a scene without unloading the current one. Which code snippet is correct?
Attempts:
2 left
💡 Hint
Check the correct enum name for additive loading.
✗ Incorrect
LoadSceneMode.Additive is the correct enum to load a scene additively.
🚀 Application
expert3:00remaining
How to ensure a scene is fully unloaded before loading another?
You want to unload "SceneA" and then load "SceneB" only after unloading completes. Which approach ensures this order?
Unity
using UnityEngine; using UnityEngine.SceneManagement; public class SceneSwitcher : MonoBehaviour { public void SwitchScenes() { // Fill in the blanks } }
Attempts:
2 left
💡 Hint
Think about waiting for the unload operation to finish before loading.
✗ Incorrect
Yielding the AsyncOperation returned by UnloadSceneAsync waits until unloading finishes before loading the next scene.