Nerd For Tech
Published in

Nerd For Tech

Unity Tip: Animation Curve Graphs

Recently I found out about a clever and helpful option when you need to visualize Unity data in a graph-like form in the editor.

Animation Curves:

Animation Curves are a feature of Unity commonly used for visualizing and creating animations with Unity’s inbuilt Animation system.

However, they can also be repurposed for a variety of uses outside of animation. For example, I made a dynamic flower mesh using Animation Curves for the length/width/height not long ago.

Animation Curves as a graph:

Animation Curves can also act as a visual graph which is populated at runtime with whatever numeric data values you want.

An Animation Curve graph being populated at runtime.
A graph showing the height of a foot during a step from point A to point B.

Creating the graph:

In any MonoBehaviour C# script, create a new Animation Curve variable. Animation Curves are a part of the UnityEngine namespace.

The above example in practice

Now you can see that any numeric data can be added to this to make a convenient graph of points. This is a great and easy way to get a visual representation of your game data.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vincent Taylor

Vincent Taylor


Unity game developer / C# Programmer / Gamer. Australian (Tasmanian) indie games developer for 10+ years. Currently looking for games industry employment.