title: How can I make that each agent will return to his original position too?
body: <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.AI;
  
  public class AgentControl : MonoBehaviour
  {
      public List&lt;Transform&gt; points;
  
      private int destPoint = 0;
      private NavMeshAgent agent;
      private Transform originalPos;
  
      void Start()
      {
          agent = GetComponent&lt;NavMeshAgent&gt;();
  
          // Disabling auto-braking allows for continuous movement
          // between points (ie, the agent doesn't slow down as it
          // approaches a destination point).
          agent.autoBraking = false;
  
          originalPos = transform;
          points.Add(originalPos);
  
          GotoNextPoint();
      }
  
  
      void GotoNextPoint()
      {
          // Returns if no points have been set up
          if (points.Count == 0)
              return;
  
          // Set the agent to go to the currently selected destination.
          agent.destination = points[destPoint].position;
  
          // Choose the next point in the array as the destination,
          // cycling to the start if necessary.
          destPoint = (destPoint + 1) % points.Count;
      }
  
  
      void Update()
      {
          // Choose the next destination point when the agent gets
          // close to the current one.
          if (!agent.pathPending &amp;&amp; agent.remainingDistance &lt; 1f)
              GotoNextPoint();
      }
  }
  </code></pre>
  
  <p>The script is attached to each agent.</p>
  
  <p>I have 2 agents. The first agent have one waypoint the second agent have eight waypoints.
  Both agents move between the waypoints in a loop.
  I want that one of the waypoints will be also the start original position of them so each agent will move also to his first original start position as part of the points.</p>
  
  <p>I tried to add this in the Start</p>
  
  <pre><code>originalPos = transform;
  points.Add(originalPos);
  </code></pre>
  
  <p>But it didn't change anything. The first agent move to his one waypoint and stay there the second agent make loop between the waypoints but without the start position.</p>