TagAI

How to make an AI Enemy Car in which it follows the track during the Race ?

H

The AI for enemy car can be done by using waypoints method.. the following code is used var waypoint : Transform[]; var speed : float =20; private var currentWaypoint : int; var loop : boolean = true; function Awake() {waypoint[0]=transform;} function Update () { if(currentWaypoint < waypoint.Length) { var target : Vector3 = waypoint[currentWaypoint].position; var moveDirection : Vector3 =...

Category