title: How can I move an object towards another object in Unity3D?
body: <p>I have a cube that I want to always be moving towards my player. I've tried several solutions over the course of a few hours, but none of them have worked. My current script looks like this.</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class fol : MonoBehaviour {
  
      // Use this for initialization
      void Start () {
  
      }
  
      public GameObject Player;
      // Update is called once per frame
      void Update ()
      {
          Vector3.MoveTowards(Player.transform.position.x, Player.transform.position.y, Player.transform.position.z, 1);
      }
  }
  </code></pre>
  
  <p>This script is a child of the object that I want to move towards my player. </p>
  
  <p>Nothing has ever compiled. The only error for this script is:</p>
  
  <blockquote>
    <p>Assets/fol.cs(16,11): error CS1501: No overload for method MoveTowards takes 4 arguments</p>
  </blockquote>
  
  <p>So, once I remove the 1 it ends up with:</p>
  
  <blockquote>
    <p>Assets/fol.cs(16,11): error CS1502: The best overloaded method match for UnityEngine.Vector3.MoveTowards(UnityEngine.Vector3, UnityEngine.Vector3, float)' has some invalid arguments</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>Assets/fol.cs(16,49): error CS1503: Argument #1 cannot convert float expression to type UnityEngine.Vector3</p>
  </blockquote>