PlatformerUtilities.

SmoothDamp(Vector2, Vector2, Vector2, float) Method

Summary

Returns the `target` if `smoothTime` is 0. Otherwise calls UnityEngine.Vector2.SmoothDamp(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector2@,System.Single).
Assembly
PlatformerGameKit.dll
Namespace
PlatformerGameKit
Containing Type
PlatformerUtilities

Syntax

public static Vector2 SmoothDamp(Vector2 current, Vector2 target, ref Vector2 velocity, float smoothTime)

Remarks

UnityEngine.Vector2.SmoothDamp(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector2@,System.Single) has a (very small) minimum threshold for `smoothTime` which can prevent the result from exactly reaching the `target` and is often undesirable.

Parameters

Name Type Description
current Vector2
target Vector2
velocity Vector2
smoothTime float

Return Value

Type Description
Vector2