Skip to content

API > AnimationCurve


AnimationCurve⚓︎

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

Members⚓︎

Properties⚓︎

Name Description
AnimationCurve.keysProperty All keys defined in the animation curve.
AnimationCurve.lengthProperty The number of keys in the curve. (Read Only)
AnimationCurve.postWrapModeProperty The behaviour of the animation after the last keyframe.
AnimationCurve.preWrapModeProperty The behaviour of the animation before the first keyframe.

Constructor⚓︎

Name Description
AnimationCurve(keys[])Constructor Creates an animation curve from an arbitrary number of keyframes.
AnimationCurve()Constructor Creates an empty animation curve.

Methods⚓︎

Name Description
AnimationCurve.AddKey(time, value) Method Add a new key to the curve.
AnimationCurve.AddKey(key) Method Add a new key to the curve.
AnimationCurve.Evaluate(time) Method Evaluate the curve at time.
AnimationCurve.MoveKey(index, key) Method Removes the keyframe at index and inserts key.
AnimationCurve.RemoveKey(index) Method Removes a key.
AnimationCurve.SmoothTangents(index, weight) Method Smooth the in and out tangents of the keyframe at index.
A weight of 0 evens out tangents.

Static Methods⚓︎

Name Description
AnimationCurve.Constant(timeStart, timeEnd, value) Static fieldMethod Creates a constant "curve" starting at timeStart, ending at timeEnd and with the value value.
AnimationCurve.EaseInOut(timeStart, valueStart, timeEnd, valueEnd) Static fieldMethod Creates an ease-in and out curve starting at timeStart, valueStart and ending at timeEnd, valueEnd.
AnimationCurve.Linear(timeStart, valueStart, timeEnd, valueEnd) Static fieldMethod A straight Line starting at timeStart, valueStart and ending at timeEnd, valueEnd.