Making a 2d object lookat a 3d object on the y-axis(c#)

I have an enemy ai with a 2d health bar above his head and I want the health bar to look at the main player but only rotate on the Y-axis. Right now I have:

        Vector3 targetPos = target.position;
        Vector3 lookRot = new Vector3(0, targetPos.y, 0);

but this changings the position of the health bar and makes it spawn in a different location. Anyone know why?

Just have it look at target Pos, then set the rotation after, it is trying to look up and at 0,somewhere,0