title: Roll an object towards the player like a ball
body: <p>I am trying to make a game object which is basically a ball. For now, I can bring the ball towards the player with the FollowPlayer Script, but cannot rotate towards the player like a ball. Requesting assistance, The code is as of the following:</p>
  <p><code>public float MaxDistance; private Transform Player; public float moveSpeed;</code></p>
  <pre><code>// Start is called before the first frame update
  void Start()
  {
      Player = GameObject.FindGameObjectWithTag(&quot;Player&quot;).transform;
      
  }
  
  // Update is called once per frame
  void Update()
  {
  
      if(Vector3.Distance(Player.transform.position, gameObject.transform.position)&lt;= MaxDistance)
      {
          FollowPlayer();
      }
  }
  
  void FollowPlayer()
  {
      var lookPos = Player.position - transform.position;
      lookPos.y = 0;
      var rotation = Quaternion.LookRotation(lookPos);
  
      
      transform.Translate(Vector3.forward * Time.deltaTime * moveSpeed);
      transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime);
  }
  </code></pre>