SpringDamper(float, float, float, float, float)
Calculate a one-dimensional mass-spring-damper simulation which drives towards a zero translation. You can then compute the new position using: "translation += newSpeed * deltaTime;"
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Method
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public static float SpringDamper(float frequency, float damping, float translation, float speed, float deltaTime)
Parameters
Returns
Type | Description |
|---|---|
| float | The new calculated spring speed. |