05.animating-the-push-wall

Animating the wall pushing

In this video, we design the wall’s push animation. We’ll use the animation to throw the player off course.

New concepts

Easing equations

Easings are equations that describe how the computer should calculate values between two animation keyframes. We use them to make animations feel natural.

In Godot’s animation editor, we can use easings to modify the property’s rate of change over time. For example, we can change it from a linear rate of change to other functions like quadratic, exponential, etc.

When you select a keyframe in the Animation editor, the Easing curve in the Inspector shows you how the value will transition from this keyframe.

A value greater than 1.0 accelerates the animation’s rate of change until it reaches the next keyframe.

A value between 0.0 and 1.0 makes the animation start fast and slow down as it reaches the next keyframe.

You can use negative values to make the animation accelerate and decelerate. Double-click on the curve to edit the value manually.

Finally, you can right-click on the easing curve to pick a value from common presets.

In the next lesson, we’ll add code to make the wall push the player.