Home
Last updated
Last updated
Playable Vehicle AI allows you to add cars that drive independently into your game.
If you want to quickly configure your environment to use Playable Vehicle AI check out the Quick Start guide.
Playable Vehicle AI allows you to create:
Basic traffic
Chase racing scenes
Car races, etc...
Features List :
Cars drive is based on the AI Navigation package and waypoints that you can create to feet the roads of your world.
Each waypoint has a list of connection. Basically the car will choose a first waypoint and then follow each connections when it reach the waypoint.
When there is several possible connections the car choose a connection randomly.
To reached the next waypoint the car use a navmesh surface to get a navpath.
To add or remove a Traffic Light on a waypoint you simply have to check / uncheck a parameter on the waypoint
You can choose the maximum speed of each car as well.
Each car contains an obstacle navmesh component (which allows overtaking when the cars do not all have the same speed). This component is automatically activated via a raycast (backward detection distance) and deactivates after a few seconds.
Each car also contains a sensor in which you can set the waypoint detection distance, a backward detection distance (detection of other cars only), enter a particular target (Hunter car concept).
By default, the car stops when it encounters another car that does not have the Navmesh Obstacle component activated or when it encounters a collider whose GameObject is named "StopCollider" or "CrossingStopCollider" (used for traffic lights)
A Car Creator Tool is available that help you to configurate several cars in seconds. It add WheelColliders, Camera, Vehicle Controller components, Vehicle AI components, etc... and all you need to create a Playable Car with AI capabilities with your own models. All you need to do at the end is to set the WheelColliders radius, suspensions and center to match your model.
A Spawn components, Unspawn components and a SpawnerManagement component are here to help you configure the way your cars will spawn, unspawn and wich waypoint will be available for spawning cars. Once again, you simply have to check a parameter on a waypoint to turn it into a Car Spawner.
Cars can be police and chase the player when he steals a car, runs a red light, exceeds the speed limit or injures another car.
To get started, you can follow the Quick Start guide which will allow you to install CarAI in your Unity project.