How it works...

The high-level AI rubber band system assigns the positions to be held by the racers. Each racer has its own behavior for adjusting the speed, especially the invincible racer. This agent works as the center of the mass of the rubber band. If its speed from the player exceeds the threshold, it will adapt. Otherwise, it'll stay just the same, wobbling.

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.