smooth looking in unity code example
Example: smooth looking in unity
Transform target; //whatever you want the object to look at
float turningRate = 2f;
turningRate /= 100;
Transform looker = null;
//create a empty gameObject on the object that you are rotating
foreach(Transform child in transform)
{
if(child.name == "Child of Transform")
{
looker = child;
}
}
looker.LookAt(targetPlayer);
transform.localRotation = Quaternion.Slerp(transform.rotation, looker.rotation, turningRate * Time.deltaTime);