#

- Developed by Dented Pixel
API Docs for: LeanTween 2.50

### Support LeanTween! |

#### Maintaining and adding new features takes time, your support is appreciated.

Show: Inherited Protected Private Deprecated

# LeanSmooth Class

Defined in: `LeanSmooth.cs:5`

Use these smooth methods to move one value towards another
Example:
fromY = LeanSmooth.spring(fromY, followArrow.localPosition.y, ref velocityY, 1.1f);
fromVec3 = LeanSmooth.damp(fromVec3, dude5Title.localPosition, ref velocityVec3, 1.1f);
fromColor = LeanSmooth.damp(fromColor, dude5Title.GetComponent().material.color, ref velocityColor, 1.1f);
Debug.Log("Smoothed y:" + fromY + " vec3:" + fromVec3 + " color:" + fromColor);

- Index
- Methods

## Item Index

### Methods

- LeanSmooth.bounceOut (Color)
- LeanSmooth.bounceOut (float)
- LeanSmooth.bounceOut (Vector3)
- LeanSmooth.damp (Color)
- LeanSmooth.damp (float)
- LeanSmooth.damp (Vector3)
- LeanSmooth.linear (Color)
- LeanSmooth.linear (float)
- LeanSmooth.linear (Vector3)
- LeanSmooth.spring (Color)
- LeanSmooth.spring (float)
- LeanSmooth.spring (Vector3)

## Methods

### `LeanSmooth.bounceOut (Color)`

(

- `current:float`
- `target:float`
- `currentVelocity:float`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`
- `[friction]`
- `[accelRate]`
- `[hitDamping]`

)

Defined in `LeanSmooth.cs:338`

Moves one color towards another (with an ease that bounces back some when it reaches it's destination)

#### Parameters:

- `current:float` Color

  the current value

- `target:float` Color

  the value we are trying to reach

- `currentVelocity:float` Color

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

- `[friction]` Float optional

  :float rate at which the spring is slowed down once it reaches it's destination

- `[accelRate]` Float optional

  :float the rate it accelerates from it's initial position

- `[hitDamping]` Float optional

  :float the rate at which to dampen the bounciness of when it reaches it's destination

#### Example:

fromColor = LeanSmooth.bounceOut(fromColor, transform.GetComponent().material.color, ref followVelocity, 1.1f);\n Debug.Log("current:" + fromColor);

### `LeanSmooth.bounceOut (float)`

(

- `current:float`
- `target:float`
- `currentVelocity:float`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`
- `[friction]`
- `[accelRate]`
- `[hitDamping]`

)

Defined in `LeanSmooth.cs:268`

Moves one value towards another (with an ease that bounces back some when it reaches it's destination)

#### Parameters:

- `current:float` Float

  the current value

- `target:float` Float

  the value we are trying to reach

- `currentVelocity:float` Float

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

- `[friction]` Float optional

  :float rate at which the spring is slowed down once it reaches it's destination

- `[accelRate]` Float optional

  :float the rate it accelerates from it's initial position

- `[hitDamping]` Float optional

  :float the rate at which to dampen the bounciness of when it reaches it's destination

#### Example:

followVar = LeanSmooth.bounceOut(followVar, destinationVar, ref followVelocity, 1.1f);\n Debug.Log("current:"+followVar);

### `LeanSmooth.bounceOut (Vector3)`

(

- `current:float`
- `target:float`
- `currentVelocity:float`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`
- `[friction]`
- `[accelRate]`
- `[hitDamping]`

)

Defined in `LeanSmooth.cs:312`

Moves one value towards another (with an ease that bounces back some when it reaches it's destination)

#### Parameters:

- `current:float` Vector3

  the current value

- `target:float` Vector3

  the value we are trying to reach

- `currentVelocity:float` Vector3

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

- `[friction]` Float optional

  :float rate at which the spring is slowed down once it reaches it's destination

- `[accelRate]` Float optional

  :float the rate it accelerates from it's initial position

- `[hitDamping]` Float optional

  :float the rate at which to dampen the bounciness of when it reaches it's destination

#### Example:

transform.position = LeanSmooth.bounceOut(transform.position, followTrans.position, ref followVelocity, 1.1f);\n Debug.Log("current:"+transform.position);

### `LeanSmooth.damp (Color)`

(

- `current:Color`
- `target:Color`
- `currentVelocity:Color`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`

)

Defined in `LeanSmooth.cs:83`

Moves one color value towards another color (eases in and out to destination with no overshoot)

#### Parameters:

- `current:Color` Float

  the current value

- `target:Color` Float

  the value we are trying to reach

- `currentVelocity:Color` Float

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

#### Example:

fromColor = LeanSmooth.damp(fromColor, transform.GetComponent().material.color, ref velocityColor, 1.1f);\n Debug.Log("current:"+fromColor);

### `LeanSmooth.damp (float)`

(

- `current:float`
- `target:float`
- `currentVelocity:float`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`

)

Defined in `LeanSmooth.cs:18`

Moves one value towards another (eases in and out to destination with no overshoot)

#### Parameters:

- `current:float` Float

  the current value

- `target:float` Float

  the value we are trying to reach

- `currentVelocity:float` Float

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

#### Example:

followVar = LeanSmooth.damp(followVar, destinationVar, ref followVelocity, 1.1f);\n Debug.Log("current:"+followVar);

### `LeanSmooth.damp (Vector3)`

(

- `current:Vector3`
- `target:Vector3`
- `currentVelocity:Vector3`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`

)

Defined in `LeanSmooth.cs:60`

Moves one value towards another (eases in and out to destination with no overshoot)

#### Parameters:

- `current:Vector3` Float

  the current value

- `target:Vector3` Float

  the value we are trying to reach

- `currentVelocity:Vector3` Float

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

#### Example:

transform.position = LeanSmooth.damp(transform.position, destTrans.position, ref followVelocity, 1.1f);\n Debug.Log("current:"+transform.position);

### `LeanSmooth.linear (Color)`

(

- `current:float`
- `target:float`
- `moveSpeed:float`
- `deltaTime:float`

)

Defined in `LeanSmooth.cs:246`

Moves one color towards another (at a constant speed)

#### Parameters:

- `current:float` Color

  the current value

- `target:float` Color

  the value we are trying to reach

- `moveSpeed:float` Float

  the speed at which to move towards the target

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

#### Example:

fromColor = LeanSmooth.linear(fromColor, transform.GetComponent().material.color, 50f);\n Debug.Log("current:"+fromColor);

### `LeanSmooth.linear (float)`

(

- `current:float`
- `target:float`
- `moveSpeed:float`
- `deltaTime:float`

)

Defined in `LeanSmooth.cs:193`

Moves one value towards another (at a constant speed)

#### Parameters:

- `current:float` Float

  the current value

- `target:float` Float

  the value we are trying to reach

- `moveSpeed:float` Float

  the speed at which to move towards the target

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

#### Example:

followVar = LeanSmooth.linear(followVar, destinationVar, 50f);\n Debug.Log("current:"+followVar);

### `LeanSmooth.linear (Vector3)`

(

- `current:float`
- `target:float`
- `moveSpeed:float`
- `deltaTime:float`

)

Defined in `LeanSmooth.cs:225`

Moves one value towards another (at a constant speed)

#### Parameters:

- `current:float` Vector3

  the current value

- `target:float` Vector3

  the value we are trying to reach

- `moveSpeed:float` Float

  the speed at which to move towards the target

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

#### Example:

transform.position = LeanSmooth.linear(transform.position, followTrans.position, 50f);\n Debug.Log("current:"+transform.position);

### `LeanSmooth.spring (Color)`

(

- `current:float`
- `target:float`
- `currentVelocity:float`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`
- `[friction]`
- `[accelRate]`

)

Defined in `LeanSmooth.cs:167`

Moves one color towards another (eases in and out to destination with possible overshoot bounciness)

#### Parameters:

- `current:float` Color

  the current value

- `target:float` Color

  the value we are trying to reach

- `currentVelocity:float` Color

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

- `[friction]` Float optional

  :float rate at which the spring is slowed down once it reaches it's destination

- `[accelRate]` Float optional

  :float the rate it accelerates from it's initial position

#### Example:

fromColor = LeanSmooth.spring(fromColor, transform.GetComponent().material.color, ref velocityColor, 1.1f);\n Debug.Log("current:"+fromColor);

### `LeanSmooth.spring (float)`

(

- `current:float`
- `target:float`
- `currentVelocity:float`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`
- `[friction]`
- `[accelRate]`

)

Defined in `LeanSmooth.cs:107`

Moves one value towards another (eases in and out to destination with possible overshoot bounciness)

#### Parameters:

- `current:float` Float

  the current value

- `target:float` Float

  the value we are trying to reach

- `currentVelocity:float` Float

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

- `[friction]` Float optional

  :float rate at which the spring is slowed down once it reaches it's destination

- `[accelRate]` Float optional

  :float the rate it accelerates from it's initial position

#### Example:

followVar = LeanSmooth.spring(followVar, destinationVar, ref followVelocity, 1.1f);\n Debug.Log("current:"+followVar);

### `LeanSmooth.spring (Vector3)`

(

- `current:float`
- `target:float`
- `currentVelocity:float`
- `smoothTime:float`
- `maxSpeed:float`
- `deltaTime:float`
- `[friction]`
- `[accelRate]`

)

Defined in `LeanSmooth.cs:142`

Moves one value towards another (eases in and out to destination with possible overshoot bounciness)

#### Parameters:

- `current:float` Vector3

  the current value

- `target:float` Vector3

  the value we are trying to reach

- `currentVelocity:float` Vector3

  the current velocity of the value

- `smoothTime:float` Float

  roughly the time it takes to reach the destination

- `maxSpeed:float` Float

  the top speed you want the value to move at (defaults to unlimited -1f)

- `deltaTime:float` Float

  the difference in time since the method was called (defaults to Time.deltaTime)

- `[friction]` Float optional

  :float rate at which the spring is slowed down once it reaches it's destination

- `[accelRate]` Float optional

  :float the rate it accelerates from it's initial position

#### Example:

transform.position = LeanSmooth.spring(transform.position, destTrans.position, ref followVelocity, 1.1f);\n Debug.Log("current:"+transform.position);