GameObject Rotation?

Hey more-experienced developers!
I’ve been working on a top-down 3d game lately, and I would like to make my character (which is a game object) to look at my cursor, rotating on the Y axis. This is the code I’ve been trying to use:

#pragma strict

var target : Transform;

function Start () {

}

function Update () {

var mouse_pos : Vector3;
var object_pos : Vector3;
var angle : float;

mouse_pos = Input.mousePosition;
mouse_pos.y = 5.23; //The distance between the camera and object
object_pos = Camera.main.WorldToScreenPoint(target.position);
mouse_pos.x = mouse_pos.x - object_pos.x;
mouse_pos.z = mouse_pos.y - object_pos.z;
angle = Mathf.Atan2(mouse_pos.z, mouse_pos.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(Vector3(0, 0, angle));
}

For some reason, it wants to rotate on my X axis, and I don’t know why. Any help would be appreciated.

I created a new scene in a new project, created a cube and attached the script to it, and made the default camera the target in the script’s inspector. It rotated around the Z axis for me, as I expected it to do when I saw the last line of code, and changing where the angle variable is used as shown below made it use the Y axis.

transform.rotation = Quaternion.Euler(Vector3(0, angle, 0));