How do I solve error CS0029: Cannot implicitly convert type `UnityEngine.Transform' to `UnityEngine.Vector3'.

Hello, I’ve got a error saying Assets/Scripts/Enemy_movement.cs(13,27): error CS0029: Cannot implicitly convert type UnityEngine.Transform' to UnityEngine.Vector3’.
this is my code

using UnityEngine;
using System.Collections;

public class Enemy_movement : MonoBehaviour {

 public float enemyspeed;
 public GameObject target;
 private int currentpoint;
 private Transform[] patrolpoints;
 void Start () 
 {

  transform.position = patrolpoints [0];
  currentpoint = 0;

 }
 
 // Update is called once per frame
 void Update () 
 {
 
  if (transform.position == patrolpoints [currentpoint].position) 
  {
   currentpoint++;
  }

  target.position=  Vector3.MoveTowards (transform.position, patrolpoints [currentpoint].position, enemyspeed * Time.deltaTime);
 }
}

Can you plese help me out with this.

The error describes the problem exactly…

transform.position = patrolpoints[0];

patrolpoints is an array of Transforms, so you can’t assign it to transform.position, which is a Vector3. You’d need to do this:

transform.position = patrolpoints[0].position;

Patrolpoints is a transform and transform.position is a vector.
Change

transform.position = patrolpoints [0];

to

transform.position = patrolpoints [0].position;

If it is the position you want of patrolpoints

or

transform = patrolpoints[0]

if you want the entire transform