Mouse Position – Unity
Code to get the Mouse Position in a 2D app Vector3 mPos = Input.mousePosition; mPos.z = -Camera.main.transform.position.z; Vector3 targetPos = Camera.main.ScreenToWorldPoint(mPos); Then to make something face towards it. yourGameObject.transform.LookAt(targetPos);