Okay so here is a script to make an object (today its a 4 x .5 x .5 cube) to track the mouse. It works half the time. As soon as the mouse goes past the 90 or 270 degree mark. The object inverts itself (I put another object at one of the cube so its pretty obvious).
I really don't want this to happen and I honestly don't understand what course to take to fix this, or if I should just look for another code altogether.
transform.LookAt(Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Mathf.Abs(Camera.main.transform.position.z))));
//these are just to keep it on the z-axis for since its a 2D game.
transform.rotation.y = 0;
transform.rotation.x = 0;