title: Rotate camera based on mouse postitions around a object Unity3D
body: <p>Okay, So I have come this far:</p>
  
  <pre><code>public class CameraScript : MonoBehaviour {
  
  public void RotateCamera()
      {
          float x = 5 * Input.GetAxis("Mouse X");
          float y = 5 * -Input.GetAxis("Mouse Y");
          Camera.mainCamera.transform.parent.transform.Rotate (y,x,0);
      }
  
  }
  </code></pre>
  
  <p>My camera has a parent which I rotate based on my mouse position. The only problem is that I can only swipe with the mouse to rotate the object. How can I rotate the object which is my camera is attached to based on my mouse position if I just click next to the object. Thanks in advance!</p>