Rotating something towards a specific point using Slerp?

I have an object that I want to rotate towards a Vector3 position. How do I achieve this using Slerp? Right now I’m using LookAt, but this wont work for my purposes. I just want to rotate the y axis towards a target.

I think this would perfectly work for you.

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    public Transform from;
    public Transform to;
    public float speed = 0.1F;
    void Update() {
        transform.rotation = Quaternion.Slerp(from.rotation, to.rotation, Time.time * speed);

To elaborate a bit, add the gameobject to be rotated to the ‘from’ transform and for the ‘to’ transform add the target object.

It would create a smooth rotation.

zTarget = Quaternion.Euler(Vector3(zCurrent.x, y, angleFlip));
ChangeDirection(zCurrent, zTarget);

function ChangeDirection(zCurrent : Quaternion, zTarget : Quaternion){
   // Dampen towards the target rotation
   var pointInTime : float = 0.0;
   while (pointInTime <= rotationDamping) {
      transform.localRotation = Quaternion.Slerp(zCurrent, zTarget, pointInTime/rotationDamping);
      pointInTime += Time.deltaTime;
      yield 0;