1. Project Overview
FastFav Runner is a stable prototype that successfully implements a seamless, on-the-fly vehicle switching mechanic inspired by The Crew 2. The core technical achievement of this project is the stable transition between entirely different movement paradigms (e.g., land to air) without physics clipping, frame drops, or input delay.
2. Architecture: Dynamic Mesh Swapping
To maintain high performance and prevent garbage collection (GC) spikes, I engineered the state machine to avoid instantiating and destroying GameObjects during vehicle transitions. The system uses a single, persistent player entity that dynamically swaps visual meshes and resizes colliders, all while retaining the Rigidbody's current velocity to preserve momentum.
// Simplified logic for dynamically swapping vehicle meshes and bounds
public void SwapVehicle(VehicleData newData) {
// Update visual representation without destroying the root object
vehicleMeshFilter.mesh = newData.vehicleMesh;
vehicleRenderer.material = newData.vehicleMaterial;
// Dynamically resize the collider to match the new mesh bounds
vehicleCollider.size = newData.colliderBounds;
// Update current state to route inputs to the correct movement logic
currentMovementState = newData.movementType;
// Retain Rigidbody velocity to ensure smooth transition momentum
ApplyTransitionMomentum();
}
3. Stable Rigidbody Physics
Rather than over-complicating the system with custom suspension raycasts, I constrained the prototype to utilize standard Unity Rigidbody physics combined with primitive colliders. By meticulously tuning the mass, drag, angular drag, and force application algorithms in C#, I established a highly controllable baseline. This ensures the core mechanic—the transition—is completely stable and responsive before introducing complex simulation layers.
4. Visual Polish & Game Feel
To elevate the stable mechanics, I integrated principles from the Unity Creative Core course. The sensation of speed and impact is driven heavily by targeted visual fidelity changes. I prioritized overall environmental lighting, vehicle shading, and camera feedback (such as FOV shifts and motion blur) over hyper-realistic assets, proving that strong art direction and post-processing can make a mechanically sound grey-box prototype visually compelling.
5. Retrospective
Bringing FastFav Runner to a stable state solidified my understanding of Unity's component architecture. The project served as an excellent practical exercise in identifying which components are strictly necessary for a mechanic to function, and how to structure code so that future additions (like advanced aerodynamics) can be integrated without rewriting the foundational state machine.