我正在開發一款賽車遊戲,我正在使用相同的場景將其劃分爲不同的級別。所以我想讓我的AI控制的汽車忽略上一級的方法點。如何忽略統一3d中軌道的先前方式點?
我該怎麼做?
// Checks for the distance to next way point. If it is less than written value, then pass to next way point.
if (nextWaypointPosition.magnitude < nextWaypointPassRadius)
{
currentWaypoint ++;
totalWaypointPassed ++;
// If all way points are passed, sets the current way point to first way point and increase lap.
if (currentWaypoint >= waypointsContainer.waypoints.Count)
{
currentWaypoint = 0;
lap ++;
}
}