Cannot convert `UnityEngine.Transform' expression to type `UnityEngine.Vector3'(Solved)

Trying to make a script that will enable a game object to follow a set of waypoints.
But getting error -

Assets/WaypointInvaderMove.cs(15,50): error CS1503: Argument #2' cannot convert UnityEngine.Transform’ expression to type `UnityEngine.Vector3’

Script -

using UnityEngine;
using System.Collections;

public class WaypointInvaderMove : MonoBehaviour
{

	public Transform[] movePositions; // Create array(list) of positions/co-ords
	int moveToIndex = 0;
	public float speed = 5f;

	void Update()
	{
		if(moveToIndex < movePositions.Length) //if moveToIndex is less than total array items/index do...
		{
			Vector3 newPos = Vector3.MoveTowards(transform.position, movePositions[moveToIndex], speed * Time.deltaTime);
			transform.position = newPos;

			if(newPos == movePositions[moveToIndex]) //if current position = the same as array index do...
			{
				moveToIndex++; // move to the next array index position
			}
		}
	}
}

How do I fix this problem ?

???

In line 15 you used the array movePositions
and, what is movePositions?
an array of Transforms! so you get the Transform object
you have to write movePositions[moveToIndex].Position

Change line 15 to

Vector3 newPos = Vector3.MoveTowards(transform.position, movePositions[moveToIndex].position, speed * Time.deltaTime);

Since movePositions is an array of Transforms, “movePositions[moveToIndex]” is a transform, so you have to use “.position” to get the Vector3 position of a transform.

Also Line 18 might need to be changed to

if(newPos == movePositions[moveToIndex].position)