Tier 1 Series 1

1A: The Capacity Check

Pilot Record
Student Profile
"Imagine a plane traveling 2,000 miles over 5 hours. You use a calculator to find the speed, but you accidentally type 2 divided by 5. The calculator says 0.4.

If you report that the plane is flying at 0.4 mph, you've failed the Sanity Check. You should have expected roughly 400 mph.

In programming, AI is your calculator. If you don't know what the answer *should* look like, you will accept "0.4 mph" code."

The Concept: Variables as Containers

In Chapter 1 of our guide, we learn that every piece of data in Unity needs a specific container called a Variable. These containers have a "Capacity" (the Data Type).

int: Whole numbers (Coins, Health, Ammo).
float: Numbers with decimals (Speed, Time, Gravity).
string: Text (Player Name, Dialogue).
bool: True/False (IsGrounded, IsDead).
Red Flag Detected

The Audit: Spot the "0.4 mph" Error

You ask the AI: "Track how many gold coins the player has collected." The AI gives you this:

// AI-Generated Code
public string coinCount = "0";

void AddCoin() {
    coinCount = coinCount + 1; // ERROR: Can't do math on text!
}

Because a "coin count" is a number you need to add to. Using a string (text) to hold a number is like using a cardboard box to hold a gallon of gasoline—it's the wrong container for the job.

Elite Telemetry

Research shows "Elite" teams achieve 15% faster lead times by keeping AI on a "very tight leash."

  • Small Batches Solving one problem at a time prevents logic drift.
  • Modular Design Localizing the "blast radius" of AI changes.
  • Tight Loops Rapid iteration with constant code review.

The Pilot's Correction

Corrective Protocol
// Corrected Code
public int coinCount = 0; 

void AddCoin() {
    coinCount++; // Simple, efficient, and mathematically correct.
}
Your Pilot Command
> A skilled Pilot directs the AI to use an integer (int).
Next Mission
Scope Authority