The AIVehicleController
script is the heart of the Omni Vehicle AI system. It manages AI vehicle control through two modes: Target Follow and Path Follow. It includes various settings for smooth AI behavior, such as braking, turning, reversing, and obstacle avoidance.
The script supports two AI modes that dictate how the vehicle will behave:
public enum Ai_Mode { TargetFollow, PathFollow };
public Ai_Mode AiMode;
This variable controls how quickly the AI's input (acceleration) adjusts from its current state to the desired value. A higher value results in quicker, more responsive changes, while a lower value makes the AI's inputs smoother and more gradual.
public float InputLerpSpeed = 5f;
These variables are used in Path Follow Mode. They define key points (A, B, C, D) along the path that the AI vehicle follows. These vectors are updated dynamically as the vehicle progresses along the path.