How to use Vehicles AI

The Vehicle AI is very similar to the enemy AI in operation, it also uses Waypoint Path and calculates paths through NavMesh. The Vehicle AI can be used on any vehicle in the JUTPS Vehicle class.

There's no secret, just add the Vehicle AI script to your vehicle and configure the variables.

See the parameters to configure below

Vehicle AI ParametersDescription

Enable Pathfinding

Enable NavMesh Pathfinding

Recalculate Path Refresh Rate

Time to recalculate path

Destination

Destination

Waypoint Path

Waypoint Path

Distance to Continue Path

Distance to go to next waypoint/path index

Vehicle Desaceleration Intensity

Deceleration in curves

Front Check

Front sensor

Check Nearest Point On Path

Checks the nearest point on the waypoint/path and prevents the AI from going back to a previous Waypoint

On End Path [ Stop, Reverse, Restart ]

What the vehicle will do after finishing the path

On Start Path [Unity Event]

Event called when AI start path

On Following Path [Unity Event]

Event called when AI walk along the path

On Ended [Unity Event]

Event called when AI reaches the end

Last updated