public static Vector2 SmoothDamp (Vector2 current, Vector2 target, ref Vector2 currentVelocity, float smoothTime, float maxSpeed= Mathf.Infinity, float deltaTime= Time.deltaTime);

参数

current当前位置。
target尝试达到的目标。
currentVelocity当前速度,此值由函数在每次调用时进行修改。
smoothTime达到目标所需的近似时间。值越小,达到目标的速度越快。
maxSpeed可以选择允许限制最大速度。
deltaTime自上次调用此函数以来的时间。默认情况下为 Time.deltaTime。

描述

随时间推移将一个向量逐渐改变为所需目标。

向量通过某个类似于弹簧-阻尼的函数(它从不超过目标)进行平滑。