Complete the code to declare a list of waypoints.
public List<Transform> [1];The list of waypoints is commonly named waypoints to clearly represent the points the object will move through.
Complete the code to move the object towards the current waypoint.
transform.position = Vector3.MoveTowards(transform.position, [1].position, speed * Time.deltaTime);The object moves towards the position of the current waypoint, accessed by waypoints[currentIndex].
Fix the error in the code that checks if the object reached the waypoint.
if (Vector3.Distance(transform.position, [1].position) < 0.1f) { currentIndex++; }
The distance should be checked against the current waypoint, which is waypoints[currentIndex].
Fill both blanks to loop the waypoint index correctly.
if (currentIndex >= [1].Count) { currentIndex = [2]; }
When the index reaches the count of waypoints, reset it to 0 to loop back to the first waypoint.
Fill all three blanks to create a dictionary mapping waypoint names to their positions if the position's x is greater than 0.
var waypointDict = new Dictionary<string, Vector3>() { { [1], [2] } for int i = 0; i < waypoints.Count; i++ if (waypoints[i].position.x [3] 0) };The dictionary keys are waypoint names, values are positions, and the condition checks if x is greater than 0.