Hi, I have been looking at some examples for this, but this is not working, I just want the object to look at another object but only rotate around the y axis, but the object looks at the sky isntead. This is the script:
using UnityEngine;
using System.Collections;
public class stuff : MonoBehaviour {
public Transform target;
public float velocity;
void Update () {
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(target.transform.position - transform.position), Time.deltaTime * velocity);
}
}
Thanks in advance.