Ai help please

Hey guys I have this problem with my enemyAi where when I am in a certain distance and in his field of view he will look at me.
But if I am in that distance and in his field of view and I jump he will also turn vertically, its hard for me to describe since english is not my native language.

Could you guys help me? I don’t know how to let the enemy rotate only his Y and not his X and Z

This is my code for the lookAt

void lookAt () {
		if(enemyDead == false){
			Quaternion rotation = Quaternion.LookRotation(Target.transform.position - transform.position);
			transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * turnSpeed);
		}
	}

I think I did something like this with forks in my game Party Business.

What I did was calculated the goal rotation like you did here, then I used Eulers to combine just the .y value of the Euler with the current rotation. Something like this but I may be remembering wrong:

//set newrotation with lookrotation

//set oldrotation to current rotation

//then combine the two
Quaternion adjustedrotation =  Quaternion.Euler(oldrotation,eulerAngles.x,newrotation.eulerAngles.y,oldrotation.eulerAngles.z);

Thanks for the response, but I dont get how I would implement this in my code?

You make a new rotation using the x and z from one rotation’s eulerAngles and the y from the other rotation. What’s missing?