#pragma strict
// ShowGoldenPath.cs
public class ShowGoldenPath extends MonoBehaviour {
public var target: Transform;
private var path: NavMeshPath;
private var elapsed: float = 0.0f;
function Start() {
path = new NavMeshPath();
elapsed = 0.0f;
}
function Update() {
// Update the way to the goal every second.
elapsed += Time.deltaTime;
if (elapsed > 1.0f) {
elapsed -= 1.0f;
NavMesh.CalculatePath(transform.position, target.position, NavMesh.AllAreas, path);
}
for (var i: int = 0; i < path.corners.Length - 1; i++)
Debug.DrawLine(path.corners[i], path.corners[i + 1], Color.red);
}
}
Hello There!
how use this waypoints to create a car AI, because i have problems to create Transform[ ] and set steerings