AnimationCurve
The AnimationCurve class represents a curve that defines the interpolation between keyframes over time. It's commonly used in animation systems to define smooth transitions between different values over time. Unity's AnimationCurve Documentation
Properties
The number of keys in the curve. Unity's AnimationCurve.length Documentation
Methods
Tool designed to insert a new key into your AnimationCurve. A way to dynamically shape your animation by adding keyframes at certain times with specific values. Unity's AnimationCurve.AddKey Documentation
Parameters
time
The time at which the new key should be inserted.
value
The value of the new key at the specified time.
Returns
Returns the index of the added key, or of the existing key if one already exists at the given time.
Erase all keys from the AnimationCurve. It can be beneficial when you need to reset the curve or want to dynamically generate a new one. Unity's AnimationCurve.ClearKeys Documentation
Returns
Creates a new AnimationCurve where all values are the same (constant). This can come in handy when creating a stable, unchanging behavior. Unity's AnimationCurve.Constant Documentation
Parameters
timeStart
The starting time of the curve.
timeEnd
The ending time of the curve.
value
The constant value for the curve.
Returns
Returns a new AnimationCurve with a constant value.
Copies all settings, including all keys from the given curve. This can prove useful when you want to duplicate the behavior of an existing curve. Unity's AnimationCurve.CopyFrom Documentation
Parameters
other
The source AnimationCurve to copy from.
Returns
Creates a new AnimationCurve that smoothly transitions between the start and end values over a specified time period. This method is especially useful to create animations with smooth starts and ends, providing a more natural look. Unity's AnimationCurve.EaseInOut Documentation
Parameters
timeStart
The starting time of the curve.
valueStart
The value of the curve at the start time.
timeEnd
The ending time of the curve.
valueEnd
The value of the curve at the end time.
Returns
Returns a new AnimationCurve with smooth transitions at start and end.
Parameters
other
Returns
Interpolates the value from the curve at a given time point. The curve is evaluated, giving the value of the curve at that exact time. This becomes very handy when lerping between two values in a non-linear way for smoother transitions. Unity's AnimationCurve.Evaluate Documentation
Parameters
time
The time at which to evaluate the curve.
Returns
Returns the value of the curve at the specified time.
Creates a new AnimationCurve representing a linear interpolation between a start and end value (valueStart and valueEnd) over a specified time period (timeStart to timeEnd). This is particularly useful when a linear transition between two states is required over a given duration. Unity's AnimationCurve.Linear Documentation
Parameters
timeStart
The starting time of the curve.
valueStart
The value of the curve at the start time.
timeEnd
The ending time of the curve.
valueEnd
The value of the curve at the end time.
Returns
Returns a new AnimationCurve representing a linear interpolation.
Removes the key at a specified index from your AnimationCurve. Varying curves dynamically can lead to interesting gameplay possibilities and variation in animations. Unity's AnimationCurve.RemoveKey Documentation
Parameters
index
The index of the key you want to remove.
Returns
Updates the tangent of a key in the AnimationCurve to create a smooth transition in the curve. This becomes essential while crafting natural and organic animations. Unity's AnimationCurve.SmoothTangents Documentation
Parameters
index
The index of the key to update.
weight
How much influence the tangent has. A weight of 0 will make the tangent flat.
Returns
Updated 21 days ago