Most racing AI follows waypoints and avoids other cars. **Racing AI – Overtaking & Racecraft** races them.
Every car drives a racing line computed from its own performance, brakes at the right point, follows the car ahead in its slipstream, and attacks where real drivers attack: at the end of a straight, after a tow, choosing the inside line and braking late. The car ahead covers the inside or brakes late too. Attacks can fail, and a driver who fails tucks back in and tries again on the next straight.
**Three things you will see**
- **Overtaking** – slingshot out of the slipstream, late braking on the inside, side by side into the corner, defence and clean give-ups.
- **Racing line choice** – a racing line for each car's performance, and a line chosen by each driver at every moment: the inside to attack, across to defend, back into the tow when an attack fails. The sample's lane view paints them on the asphalt.
- **Animated cars** – the AI drives the car's rig too: the front wheels steer with the line and every change of lane, the wheels spin with the speed, the nose follows the lane changes. Any model with separate wheels and steering pivots works.
**Two modes, one race director**
- **Kinematic mode** – cars are placed on the racing line from a speed simulation. Full racecraft, exactly repeatable races, about 1 ms per frame for 10 cars. For arcade opponents, management games, spectator modes and background traffic.
- **Physics mode** – the AI drives real physics cars with steering, throttle and brake. A WheelCollider car tuned from the same profile is included (traction control, ABS, stability control, slipstream, dirty air). Connect your own car controller with a short adapter script.
**Racecraft**
- Minimum-curvature racing line inside the asphalt, braking points from grip, downforce, braking and power.
- Following on the trail of the car ahead, pressure, slipstream and drag-reduction zones found automatically.
- Slingshot moves, late braking on the inside, verdict at turn-in, clean give-ups.
- Two kinds of defence, tyre wear, driver character (skill, aggression, consistency, defending).
- Difficulty from 0 to 1 and optional catch-up.
**Race logic**
- Pit stops with speed limiter, one box per team and safe releases, in both modes.
- Start lights with a random wait, standings, lap times and an event log.
- Player and AI on the same grid: the AI gives way to a car that will not yield.
- `EventRaised` for every start, attack, overtake, defence and finish, to drive your own UI and commentary.
**Plugs into your project**
- Your track: any closed centre line (road tools, modelled circuits, generators), or draw one with the included spline component.
- Your cars: kinematic, the included WheelCollider car, or your own controller through a short adapter.
- Your UI: read the standings and events from the director.
**Samples (to see it working, safe to delete)**
- Three scenes on a simple test circuit: kinematic race, physics race, and a playable race against the AI (keyboard or gamepad).
- A rigged single seater, Formula and GT profiles, a roster of 10 drivers in 5 teams.
- Sample camera, HUD, and a view that paints on the asphalt the AI's braking and acceleration zones and the line each car has chosen.
Full C# source, no external dependencies, PDF manual.
Tested in clean projects on Unity 2022.3 LTS and Unity 6, Built-in and URP.