Tier 2
Series 105
105F: The Link
"Spawning an enemy is easy. Giving it a target is hard. `Instantiate` returns the object it created. An Engineer captures this reference to configure the new clone immediately."
The Concept: Reference Injection
Configuring a clone the moment it is born.
* **Capture:** `GameObject clone = Instantiate(...);`
* **Access:** `clone.GetComponent().SetTarget(player);`
* **Rule:** Do not let clones use `Find` to locate the player.
* **Capture:** `GameObject clone = Instantiate(...);`
* **Access:** `clone.GetComponent
* **Rule:** Do not let clones use `Find` to locate the player.
Red Flag Detected
The AI Trap: "The Lost Child"
You ask the AI: "Spawn a missile and aim it at the player."
// AI-Generated Code: Search Logic
Instantiate(missile, pos, rot);
// Inside Missile Script:
void Start() { target = GameObject.Find("Player"); }
This is "Post-Birth Confusion." The missile has to search the world to find its target, wasting CPU.
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 Engineer's Correction
Corrective Protocol
// Corrected: Direct Link var m = Instantiate(missilePrefab); m.GetComponent<Missile>().SetTarget(player);
Your Pilot Command
> Capstone Mission: Audit the pathfinding logic to prevent agent jitter and stuck states.