/// <summary> /// 移动向某处 /// </summary> /// <param name="target"></param> public void flyTarget(Transform target) { transform.position = Vector3.Lerp(transform.position, target.position, Time.deltaTime * 2f); Vector3 oldAngle = transform.eulerAngles; transform.LookAt(target); transform.eulerAngles = new Vector3(0, Mathf.MoveTowardsAngle(oldAngle.y,target.eulerAngles.y,100*Time.deltaTime), 0); }
原文:http://blog.csdn.net/myk7694503/article/details/43532595