Visual Audit Protocol

The Trigger Zone

Return to Hangar
103A

Collision vs. Trigger

The Concept: Interaction Modes

P
Bounce
// AI-Generated Code: Physical Impact void OnCollisionEnter(Collision other) { // Audit Fail: The drone will physically bounce off the fuel pack // BEFORE this code runs. It feels clunky and amateur. CollectFuel(); }
P
Pass
// Corrected: Smooth and Ghost-like void OnTriggerEnter(Collider other) { // The drone flies right through, collecting the fuel instantly. CollectFuel(); }
103B

The Collision Matrix

The Concept: The Layer Collision Matrix

Physics Settings
Pla
Ene
VFX
Pla
Ene
"VFX" Ignored (0 CPU)
103C

The Layer Mask Filter

The Concept: Bitwise Masks

Layer: Cloud
HIT
Layer: Ground
// Corrected: Surgical Precision int layerMask = LayerMask.GetMask("Ground"); // The ray passes through clouds and enemies like they aren't there. if (Physics.Raycast(pos, down, out hit, 100f, layerMask)) { Land(); }
103D

The Trigger State Machine

The Concept: Enter, Stay, Exit

Enter
Frame 1
Damage Loop
Stay
Every Frame
Exit
Frame N
103E

The Trigger Threshold

The Concept: Debouncing

Update
60Hz
Timer
1Hz
// Corrected: Balanced Logic private float nextHealTime; void OnTriggerStay(Collider other) { if (Time.time > nextHealTime) { player.Heal(10); nextHealTime = Time.time + 1.0f; // Wait 1 second } }
103F

The Physics Query Audit

The Concept: NonAlloc Methods

new Collider[]
buffer[10]
Zero Alloc
// Corrected: Zero-Garbage Collider[] resultsBuffer = new Collider[10]; // Reusable Screen void Update() { // Writes into the existing buffer. No new memory created. int count = Physics.OverlapSphereNonAlloc(pos, 5f, resultsBuffer); }
CAPSTONE EXAM

The Trigger Exam

The sensor array is misfiring. The zones are creating garbage memory, the lasers are hitting clouds instead of targets, and the logic state is stuck on "Entry". Identify the three critical physics failures to certify your status as a Flight Engineer II.

Verify Capacity
Check Scope
Audit Efficiency