Tier 2 Series 104

104G: The Physics Exam

Capstone Exam
"The physics simulation is broken. The car falls through the floor, the jump height varies wildly depending on the computer speed, and the coins block the car like concrete walls. Identify the three critical physics failures."

Target Asset for Audit

FRAGILE_CODE_DETECTED
using UnityEngine;

public class CarController : MonoBehaviour {
    public Rigidbody rb;

    // Audit Requirement: Lesson 104A (Rigidbody)
    // Error 1: Teleporting a Rigidbody
    void Move() {
        transform.position += transform.forward * 10 * Time.deltaTime;
    }

    // Audit Requirement: Lesson 104B (Colliders)
    // Error 2: Solid Coin
    // The Coin script (not shown) uses OnCollisionEnter instead of OnTriggerEnter.

    // Audit Requirement: Lesson 104F (FixedUpdate)
    // Error 3: Physics in Update
    void Update() {
        if (Input.GetKeyDown(KeyCode.Space))
            rb.AddForce(Vector3.up * 500);
    }
}

Supervisor's Certification

Authenticated Pilot
pilot_2463c111f7d066d5
Session Secure

Failure Point #1

Tunneling Failure

The AI is moving a Rigidbody via Transform. Command it to use Velocity or Forces.

Failure Point #2

Collision Type Failure

The coins are solid. Command the AI to set IsTrigger to True.

Failure Point #3

Time Step Failure

Physics forces are applied in Update. Command the AI to use FixedUpdate.