# AnimationCurve

> Store a collection of Keyframes that can be evaluated over time.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Implements:** [IEquatable\<AnimationCurve>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public class AnimationCurve : IEquatable<AnimationCurve>
```

## Constructors

| Constructor                                                                                                                               | Description                                                       |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [AnimationCurve()](/engine/6000.0/script-reference/unityengine/animationcurve/ctor.md#animationcurve\(\))                                 | Creates an empty animation curve.                                 |
| [AnimationCurve(UnityEngine.Keyframe\[\])](/engine/6000.0/script-reference/unityengine/animationcurve/ctor.md#animationcurve\(keyframe\)) | Creates an animation curve from an arbitrary number of keyframes. |

## Properties

| Property                                                                                   | Description                                               |
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| [this\[\]](/engine/6000.0/script-reference/unityengine/animationcurve/item.md)             | Retrieves the key at index. (Read Only)                   |
| [keys](/engine/6000.0/script-reference/unityengine/animationcurve/keys.md)                 | All keys defined in the animation curve.                  |
| [length](/engine/6000.0/script-reference/unityengine/animationcurve/length.md)             | The number of keys in the curve. (Read Only)              |
| [postWrapMode](/engine/6000.0/script-reference/unityengine/animationcurve/postwrapmode.md) | The behaviour of the animation after the last keyframe.   |
| [preWrapMode](/engine/6000.0/script-reference/unityengine/animationcurve/prewrapmode.md)   | The behaviour of the animation before the first keyframe. |

## Methods

| Method                                                                                         | Description                                                                                                                                                                                                                                              |
| ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AddKey](/engine/6000.0/script-reference/unityengine/animationcurve/addkey.md)                 | Add a new key to the curve.                                                                                                                                                                                                                              |
| [ClearKeys](/engine/6000.0/script-reference/unityengine/animationcurve/clearkeys.md)           | Erases all KeyFrame from this instance of the [AnimationCurve](/engine/6000.0/script-reference/unityengine/animationcurve.md).                                                                                                                           |
| [CopyFrom](/engine/6000.0/script-reference/unityengine/animationcurve/copyfrom.md)             | Copies the keys and properties of the specified [AnimationCurve](/engine/6000.0/script-reference/unityengine/animationcurve.md) object into this instance of the  [AnimationCurve](/engine/6000.0/script-reference/unityengine/animationcurve.md) class. |
| [Evaluate](/engine/6000.0/script-reference/unityengine/animationcurve/evaluate.md)             | Evaluate the curve at time.                                                                                                                                                                                                                              |
| [GetHashCode](/engine/6000.0/script-reference/unityengine/animationcurve/gethashcode.md)       | A HashCode for the animation curve, computed using all individual [Keyframe](/engine/6000.0/script-reference/unityengine/keyframe.md).                                                                                                                   |
| [MoveKey](/engine/6000.0/script-reference/unityengine/animationcurve/movekey.md)               | Moves the key at index to /key.time/ and /key.value/.                                                                                                                                                                                                    |
| [RemoveKey](/engine/6000.0/script-reference/unityengine/animationcurve/removekey.md)           | Removes a key.                                                                                                                                                                                                                                           |
| [SmoothTangents](/engine/6000.0/script-reference/unityengine/animationcurve/smoothtangents.md) | Smooth the in and out tangents of the keyframe at index.                                                                                                                                                                                                 |

## Static Methods

| Method                                                                               | Description                                                                                         |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
| [Constant](/engine/6000.0/script-reference/unityengine/animationcurve/constant.md)   | Creates a constant "curve" starting at timeStart, ending at timeEnd, and set to the value value.    |
| [EaseInOut](/engine/6000.0/script-reference/unityengine/animationcurve/easeinout.md) | Creates an ease-in and out curve starting at timeStart, valueStart and ending at timeEnd, valueEnd. |
| [Linear](/engine/6000.0/script-reference/unityengine/animationcurve/linear.md)       | A straight Line starting at timeStart, valueStart and ending at timeEnd, valueEnd.                  |
