插值转向

//控制转向---插值转向--这段代码要写在最后
//transform.LookAt(transform.position + dir.normalized);
Quaternion myRotation = Quaternion.LookRotation(dir.normalized, Vector3.up);
Quaternion newRotation = Quaternion.Lerp(transform.rotation, myRotation, rotateSpeed * Time.deltaTime);
transform.rotation = newRotation;

posted @ 2017-11-23 21:04  三页菌  阅读(146)  评论(0编辑  收藏  举报