AITrafficController

Controls logic and movement for AITrafficCars using the Job System and Burst Compiler.

Traffic Prefabs

trafficPrefabs

Array of AITrafficCar prefabs to spawn.

Car Settings

Variables

useYieldtriggers

Enables the processing of YieldTrigger logic.

speedMultiplier

Multiplier used for calculating speed; 2.23693629 by default for MPH.

steerSensitivity

Multiplier used to control how quickly the car's front wheels turn toward the target direction.

maxSteerAngle

Maximum angle the car's front wheels are allowed to turn toward the target direction.

stopThreshold

Front detection sensor distance at which a car will start braking.

layerMask

Physics layers the detection sensors can detect.

enableLaneChanging

Enables the processing of Lane Changing logic.

changeLaneTrigger

Minimum amount of time until a car is allowed to change lanes once conditions are met.

minSpeedToChgangeLanes

Minimum speed required to change lanes.

changeLaneCooldown

Minimum time required after changing lanes before allowed to change lanes again.

unassignedBrakeMaterial

Dummy material used for brake light emission logic when a car does not have an assigned brake variable.

setCarParent

AI Cars will be parented to the 'Car Parent' transform, this AITrafficController will be the parent if a parent is not assigned.

carParent

If 'Set Car Parent' is enabled, AI Cars will be parented to this transform, this AITrafficController will be the parent if a parent is not defined.

Pooling

Variables

usePooling

Enables the processing of Pooling logic.

centerPoint

Transform that pooling distances will be checked against.

useRouteLimit

When using pooling, cars will not spawn to a route if the route limit is met.

density

Max amount of cars the pooling system is allowed to spawn.

spawnRate

Frequency at which pooling spawn is performed.

minSpawnZone

Cars can't spawn or despawn in this zone.

cullHeadLight

Car headlights will be disabled outside of this zone.

activeZone

Cars only spawn if the spawn point is not visible by the camera.

spawnZone

Cars can spawn anywhere in this zone, even if spawn point is visible by the camera. Cars outside of this zone will be despawned.

Public Methods

Last updated