title: Cannot implicitly convert type `UnityEngine.Vector3' to `bool'
body: <p>I'm doing a follow path for a enemy but getting this error:</p>
  
  <blockquote>
    <p>error CS0029: Cannot implicitly convert type UnityEngine.Vector3' to bool'</p>
  </blockquote>
  
  <p>here my code:</p>
  
  <pre><code> IEnumerator FollowPath(Vector3[] waypoints)
   {
       transform.position = waypoints[0];
  
       int targetWaypointIndex = 1;
       Vector3 targetWaypoint = waypoints[targetWaypointIndex];
  
       while (true)
       {
  
           transform.position = Vector3.MoveTowards(transform.position, targetWaypoint, speed * Time.deltaTime);
           if (transform.position = targetWaypoint) //error comes at this line
           {
               targetWaypointIndex = (targetWaypointIndex + 1) % waypoints.Length;
               targetWaypoint = waypoints[targetWaypointIndex];
               yield return new WaitForSeconds(waitTime);
           }
           yield return null;
  
       }
   }
  </code></pre>
  
  <p>and here the script used at the tutorial im doing. </p>
  
  <p><a href="https://i.stack.imgur.com/bWBGy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bWBGy.jpg" alt="enter image description here"></a></p>
  
  <p>How can I solve this issue and what am I doing wrong?</p>