title: Slowly moving gameobject to mouse position
body: <p>I want to change the position of the object to the position of the mouse, moving slowly from first to second position.</p>
  
  <p>My object is moving slowly to the random direction which appears to be connected with lower-left corner. When I go higher than the corner my object is moving upwards, same with left and right.</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class Rocket : MonoBehaviour
  {
      public float speed = 10f;
  
      private Vector3 shippos;
  
      void Start()
      {
          shippos = transform.position;
      }
  
      void FixedUpdate()
      {
          if (Input.mousePosition.x &gt; shippos.x)
              shippos.x=shippos.x+speed*Time.deltaTime;
          if (Input.mousePosition.x &lt; shippos.x)
              shippos.x=shippos.x-speed*Time.deltaTime;
          if (Input.mousePosition.y &gt; shippos.y)
              shippos.y=shippos.y+speed*Time.deltaTime;
          if (Input.mousePosition.y &lt; shippos.y)
              shippos.y=shippos.y-speed*Time.deltaTime;
          transform.position = shippos;
      }
  }
  </code></pre>