Sentry Gun. Looking for left and right turn. Not up and down.

How do make sentry gun move left and right axis. I don’t want gun move up and down.
Here’s my code…

  myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);

I think if you copy the “To” position to a new Vector, and change the Y value to be the same as the “From” position, you’ll strip out the pitch rotation.

You can take a look at my simple turret project which does this for the base of the turret.

https://bitbucket.org/freakshowstudio/simpleturret