Quaternion Rotate Towards Y Value

How do I change this line of code: transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.identity, speed * Time.deltaTime); so that Quaternion.identity only cares about rotating towards the y axis? Thanks!

Words often mislead on questions like this one, and I’m doing a bit of guessing on what you want. Try this:

 var q : Quaternion = Quaternion.FromToRotation(transform.up, Vector3.up) * transform.rotation;
 Quaternion.RotateTowards(transform.rotation, q, speed * Time.deltaTime);

If this is not what you are looking for, provide a more detailed description and/or a drawing.