Rotate object on one axis with slerp

I am trying to make my player model rotate with the camera orbit script, but only on the Y axis.
So far I can have it rotate on every axis for the camera. This is what I’ve tried:

var Player : Transform;
var playerRotateSpeed = 2.0;

function Update () {
	rot = transform.rotation; //rotation of the camera
	Player.transform.rotation = Quaternion.Slerp(Player.transform.rotation, rot, playerRotateSpeed);

}

If I try (Player.transform.rotation.y, rot, playerRotateSpeed) it gives me an error saying slerp can only use (Quaternion, Quaternion, Float) and I’m giving it (Float, Quaternion, Float). Same if I try rot.y or anything else.

How can I get the rotation of one axis of my camera and Player in Quaternion form?

Using JS. This is probably really simple - I apologize as I only know C# and this mouse orbit script was in JS.

No, that’s not so simple: you could use transform.eulerAngles.y to know the rotation around Y, but if the other X and Z components aren’t zero, weird values may be returned. A more reliable alternative is to isolate only the horizontal camera direction and Slerp to it:

var Player : Transform;
var playerRotateSpeed = 2.0;

function Update () {
    var dir = transform.forward; // get camera forward vector...
    dir.y = 0; // but keep only the horizontal direction
    var rot = Quaternion.LookRotation(dir); // now get the desired rotation
    Player.transform.rotation = Quaternion.Slerp(Player.transform.rotation, rot, playerRotateSpeed * Time.deltaTime);
}

Notice that I’ve multiplied playerRotateSpeed by Time.deltaTime in order to get frame rate independence.