Applying gravity to simple zombie AI

I made a simple zombie ai that follows the player, however, when the player is above the zombie the zombie will fly straight at the player instead of staying on the ground. Could someone please give me feedback (in C#) on how to keep the zombie on the ground? Here is my code:

 Debug.DrawLine(myTransform.position, target.transform.position); //draw line (in pause mode) from enemy to player
                myTransform.rotation = Quaternion.Slerp(myTransform.rotation, //causes enemy to look at player
                	Quaternion.LookRotation(target.position - myTransform.position),//causes enemy to look at player
                		rotationSpeed * Time.deltaTime);//causes enemy to look at player
               
                 myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime; //tells enemy to move toward player

What you want to do is just apply that rotation on the enemy’s Y axis. Change your myTransform.rotation to this:

dirToPlayer = target.position - myTransform.position;

myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.Euler(0, Quaternion.LookRotation(dirToPlayer).eulerAngles.y, 0), rotationSpeed * Time.deltaTime);

That will only apply that rotation on the Y axis of the zombie.