标签:实现 class nbsp speed vat 编程学习 orm form ati
当目标点移动后,摄像机稍晚一步跟随移动,并在目标点停止时出现"平缓制动"效果.
脚本实现:
public float Speed; //跟随速度 public Transform TargetPos; //目标点信息 private Vector3 _distance; //距离 void Start() { _distance = transform.position - TargetPos.position; Speed = 5; } void LateUpdate() { Vector3 newPos = TargetPos.position + _distance; transform.position = Vector3.Lerp(transform.position, newPos, Speed * Time.deltaTime); }
标签:实现 class nbsp speed vat 编程学习 orm form ati
原文地址:https://www.cnblogs.com/RainPaint/p/9834880.html