How do i rotate it around Y?

I need to rotate spaceship tower(like a tank tower), but i need to keep Z and X empty.

        var ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        RaycastHit hit;
        if (Physics.Raycast(ray, out hit, Mathf.Infinity))
        {
            var eulers = transform.eulerAngles;
            Vector3 targetPoint = hit.point;
            var targetRotation = Quaternion.LookRotation(targetPoint - transform.position);
            Debug.Log(transform.eulerAngles);
            transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, 2f * Time.deltaTime);
            eulers = new Vector3(0, eulers.y, 0);
            transform.eulerAngles = eulers;

alt text

Hi, Inoreder to make it rotate it only on y axis
just add this code to your script

//This Code makes the object ot rotate only on Y axis

transform.eulerAngles = Vector3(0,transform.eulerAngles.y,0); 
//then make it rotate
transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, 2f * Time.deltaTime);