AI Command Lab // Flight Simulator
200F: The Automated Landing
Initial AI Output (Fragile)
// AI-Generated Code: The Game Freezer
void Die() {
// Audit Fail: This freezes the ENTIRE game engine for 3 seconds.
System.Threading.Thread.Sleep(3000);
Respawn();
}
Initial AI Prompt
"You ask the AI: "Wait 3 seconds before respawning the player.""
Pilot Comm Link
Mission Objective: A skilled Architect directs the AI to use Temporal Logic. You command: "Use a Coroutine to wait 3 seconds asynchronously."
Optimized Protocol
// Corrected: Smooth Timing
IEnumerator RespawnRoutine() {
// The game keeps running while this waits
yield return new WaitForSeconds(3);
Respawn();
}
void Die() {
StartCoroutine(RespawnRoutine());
}