Challenge - 5 Problems
NavMesh Baking 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 NavMesh baking status check?
Consider this Unity C# script snippet that checks the NavMesh baking status. What will be printed in the console?
Unity
using UnityEngine; using UnityEngine.AI; public class NavMeshStatusCheck : MonoBehaviour { void Start() { var buildSettings = NavMesh.GetSettingsByID(0); Debug.Log($"Agent Type ID: {buildSettings.agentTypeID}"); Debug.Log($"Voxel Size: {buildSettings.voxelSize}"); } }
Attempts:
2 left
💡 Hint
The default agent type ID for the first NavMesh agent is 0, and the default voxel size is 0.3.
✗ Incorrect
The NavMesh.GetSettingsByID(0) returns the default agent settings. By default, agentTypeID is 0 and voxelSize is 0.3 in Unity's NavMesh baking settings.
🧠 Conceptual
intermediate1:30remaining
Which component is essential for NavMesh baking in Unity scenes?
In Unity, to bake a NavMesh for AI navigation, which component must be present on the GameObjects that define walkable surfaces?
Attempts:
2 left
💡 Hint
This component defines the area where the NavMesh is generated.
✗ Incorrect
NavMeshSurface is the component that marks the geometry to be included in the NavMesh baking process. NavMeshAgent is for moving agents, NavMeshObstacle blocks paths, and NavMeshLink connects separate NavMeshes.
🔧 Debug
advanced2:30remaining
Why does this NavMesh baking code fail to update the NavMesh?
This Unity C# code attempts to bake a NavMesh at runtime but does not update the navigation mesh as expected. What is the cause?
Unity
using UnityEngine; using UnityEngine.AI; public class RuntimeNavMeshBake : MonoBehaviour { public NavMeshSurface surface; void Start() { surface.BuildNavMeshAsync(); Debug.Log("NavMesh baking started."); } }
Attempts:
2 left
💡 Hint
Async baking returns a handle that controls job completion.
✗ Incorrect
BuildNavMeshAsync starts an asynchronous job and returns a JobHandle. Without completing this job, the NavMesh is not fully baked. You must call Complete() on the JobHandle to finish baking.
📝 Syntax
advanced1:30remaining
Identify the syntax error in this NavMesh baking code snippet.
Which option contains the correct syntax to bake a NavMesh using NavMeshSurface in Unity?
Unity
public class BakeNavMeshExample : MonoBehaviour
{
public NavMeshSurface surface;
void Bake()
{
// Bake the NavMesh here
}
}Attempts:
2 left
💡 Hint
Check the exact method name and usage.
✗ Incorrect
The correct method to bake the NavMesh synchronously is BuildNavMesh(). BuildNavMeshAsync() requires parentheses and returns a JobHandle. BakeNavMesh() does not exist. Missing parentheses cause syntax errors.
🚀 Application
expert3:00remaining
How many NavMesh areas are created after this baking setup?
You have a Unity scene with two NavMeshSurface components. One is set to include only the "Walkable" layer, and the other includes only the "Jump" layer. After baking both surfaces, how many distinct NavMesh areas will exist?
Attempts:
2 left
💡 Hint
Each NavMeshSurface bakes its own area based on included layers.
✗ Incorrect
Each NavMeshSurface bakes a separate NavMesh area based on its included layers. Having two surfaces with different layers results in two distinct NavMesh areas in the scene.