Tier 3 Series 205

205C: The Composite Axis

Pilot Record
Student Profile
"W, A, S, and D are four separate keys, but they represent one idea: "Direction." Handling them as four separate "If" statements is amateur. A Pilot reads them as a single Vector2 Composite."

The Concept: Composites

Merging multiple inputs into a single data type.

* **2D Vector:** WASD or Left Stick becomes `(x, y)`.
* **1D Axis:** Triggers (L2/R2) become `float` (0.0 to 1.0).
* **Normalization:** Ensures diagonal movement isn't faster than straight movement.
Red Flag Detected

The AI Trap: "The WASD If-Chain"

You ask the AI: "Move the player with WASD."

// AI-Generated Code: Diagonal Speed Hack
void Update() {
    if (Input.GetKey(KeyCode.W)) z += 1;
    if (Input.GetKey(KeyCode.A)) x -= 1;
    // Audit Fail: Moving Diagonal results in speed 1.41 (Square Root of 2).
}

This is "The Pythagorean Cheat." Your character runs faster diagonally because the math isn't normalized.

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: Normalized Math
Vector2 move = moveAction.ReadValue<Vector2>();
// The Input System handles normalization automatically.
Your Pilot Command
> A skilled Pilot directs the AI to read the Value. You command: "Bind WASD to a Vector2 Composite and read the value directly in Update."
Next Mission
The Processor