title: 2D top-down point and click movement and rotation in Unity3D
body: <p>I'm working on point and click car movement but I could did movement only hold click to car. I want to move the car when i click any point. I wrote this code. Also is it possible smoothly rotation? because there is skidmark of car and when i turning the car, it suddenly turning can you help me?</p>
  
  <pre class="lang-cs prettyprint-override"><code>void Update()
  {
      mousePosition = Input.mousePosition;
      mousePosition = Camera.main.ScreenToWorldPoint(mousePosition);
      marker.position = mousePosition;
      if (Input.GetMouseButton(0))
      {
          moveToPosition = true;
      }
      else if (Input.GetMouseButtonUp(0))
      {
          moveToPosition = false;
          SoundManagerScript.stopCarAudioSource.Play();
          SoundManagerScript.loopEngineAudioSource.Stop();
      }
  
      if (moveToPosition)
      {
          direction = new Vector2(mousePosition.x - transform.position.x, mousePosition.y - transform.position.y);
          transform.position = Vector2.Lerp(transform.position, mousePosition, moveSpeed);
          if (Vector3.Distance(transform.position, mousePosition) &lt; 100f)
          {
              moveToPosition = false;
          }
          transform.up = direction * moveSpeed;
      }
  }
  </code></pre>