If you haven’t gotten this problem solved yet, here’s what I’d recommend trying.
The first thing you’ll need is a world-space position corresponding to the current mouse position, and lying in the plane in which the game takes place (it looks to me as if this is the xz plane).
For this step, there are a few Camera class functions that you could probably use (e.g. ScreenToWorldPoint()). What I would probably try first is ScreenPointToRay(), which will return a ray originating at the camera position and passing through the mouse screen position. You can then intersect this ray with the xz plane to yield the corresponding world position.
(I’d recommend breaking this problem into separate parts to make it a bit easier to solve. The first thing I’d do is create a temporary ‘debug’ entity with a visual attached to it, and match its position to the world-space position computed in the previous step. If all works well, it should follow the actual mouse position very closely, and you can then move onto the next step.)
All that remains is to compute the angle for the rotating object attached to your player based on its position and the mouse’s world-space position. As described earlier, this can be done using atan2(). Now that we’re computing the angle with respect to the xz plane, the pseudocode might look something like this:
Vector3 diff = mouseWorldPosition - transform.position;
float angle = Mathf.Atan2(diff.z, diff.x);
transform.eulerAngles = new Vector3(0, angle, 0);
Don’t forget to add any necessary degrees<->radians conversions. Note also that this assumes the object points along the +x axis in local space.
If you try this and the object rotates in response to mouse and player movement, but rotates the wrong way and/or points in the wrong direction, you may need to tweak the arguments to and/or the return value of Atan2() accordingly.
It might seem a little complicated, but there are really only a couple of steps involved, which you can tackle one at a time. If you have trouble implementing any of this, you can always post back here with questions.