> For the complete documentation index, see [llms.txt](https://docs.engagevr.io/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.engagevr.io/developer/afx/animation-curves.md).

# Animation curves

You can use animation curve nodes to create a two-dimensional graph that describes a changing value. The most common use is to describe how a value changes over time.

For example, you could graph how an object's velocity should change over time - describing it's acceleration or deceleration behavior. Another example could be to graph the changing rate of particle emissions over time when simulating a firework.

## Using the Animation Curve node

Use the animation curve node to define a two-dimensional graph for an animation curve.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-2f64c1fbc9aa0cde6d9672ed056dc6051b9abeb2%2Fafx_animation_curve.png?alt=media" alt=""><figcaption><p>Animation Curve node</p></figcaption></figure>

* To edit the curve, select the thumbnail rectangle. This is initially a blank gray rectangle, but will show a preview of the graph.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-4c85390bbbb2e10f6ee768959f15a7b9fcfa3949%2Fafx_curve_graph_edit.png?alt=media" alt=""><figcaption><p>Animation curve editor panel</p></figcaption></figure>

### Choosing a preset curve

* To load a preset curve, select a thumbnail at the bottom of the animation curve editor panel. If the preset that you want to use is not visible, select the cog icon to open the presets panel.

### Saving a curve as a preset

To save a curve as a preset, complete the following steps:

1. In the animation curve editor, create the curve that you want to save as a preset.
2. In the lower-left corner of the animation curve editor, select the cog icon.
3. In the **Presets** panel, select **New**.

### Adjusting keys on a curve

* To move a key, select and drag the key.
* To adjust the tangent of the curve at a key, first select the key, and then drag one of the grips that appears.

{% hint style="info" %}
By default the curve is between 0 and 1.0 on both X and Y axis. You can drag the start and end keys to change the minimum and maximum values for the curve.
{% endhint %}

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-2b3a3a03383d77f396c5c5ddf180975387dd96fb%2Fafx_graph_adjust.png?alt=media" alt=""><figcaption><p>Adjusting a point on a curve</p></figcaption></figure>

### Adding a key to a curve

* To add a key, right-click on the curve, and then select **Add Key**.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-1afb4616fcfd71c44e390dce35ee05cedefbf447%2Fafx_add_key.png?alt=media" alt=""><figcaption><p>Adding a key to a curve</p></figcaption></figure>

### Changing behavior outside of X bounds

By default, an animation curve clamps values outside the defined X (time) range. To change the behavior, select the cog icon next to either the first or last keys, and select the desired behavior from the list that appears.

{% hint style="info" %}
You can choose different behaviors for values before the graph and for values after the graph.
{% endhint %}

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-27aad971ef619d357b4068cfcf1cfc086e021819%2Fafx_curve_bounds.png?alt=media" alt=""><figcaption><p>Options to change behavior outside of set bounds</p></figcaption></figure>

The following table describes the available options.

<table><thead><tr><th width="139">Option</th><th width="304">Description</th><th></th></tr></thead><tbody><tr><td>Loop</td><td>The graph repeats the same shape.</td><td><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-e0f6ab54a73ac4b326f261890edec21cadb35cb0%2Fafx_graph_loop.png?alt=media" alt=""></td></tr><tr><td>Ping Pong</td><td>The graph is mirrored.</td><td><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-da29ad4d5b2bf793a6c8f541a30f5a67a3091c14%2Fafx_graph_ping.png?alt=media" alt=""></td></tr><tr><td>Clamp</td><td>The graph retains a constant value.</td><td><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-f6b5cc7c0a1dc108329efb3a14f0da352a72e948%2Fafx_graph_clamp.png?alt=media" alt=""></td></tr></tbody></table>

## Accessing values from an animation curve

Use an `Animation Curve Evaluate` node to access values from an animation curve. You provide the time (X axis) value, and the node outputs the corresponding Y axis value.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-f83ac6a1f811df1a23492e37cc5927a5623ea551%2Fafx_anim_curve_arrangement.png?alt=media" alt=""><figcaption><p>Using an Animation Curve Evaluate node to access values from an animation curve</p></figcaption></figure>
