Javatpoint Logo
Javatpoint Logo

Animations in Godot

Introduction

Godot's animation system is highly robust and flexible.

Add an animation player

Firstly, add an AnimationPlayer node to the scene like a child of "background" (the root node):

Animations in Godot

The animation editor panel will be appearing when the node of any type is selected:

Animations in Godot

The animation editor panel stays visible until it was manually hidden.

Creating the animation

Here we are creating a new animation!. Press the Animation button and name the animation "Intro" when the dialog appears.

Animations in Godot

Now that we have an animation, the property editors enter the "Animation Edit" node. In this mode, a key icon appears next to each property in the property editor. The feature of any object in Godot can be animated:

Animations in Godot

Editing the animation

The logo would appear from the top of the screen.

With the help of animation editor panel open, select the "logo" node and set the "Rect/ Position" property to (118,-400) and press the key button next to the property:

Animations in Godot

When the dialog is added in the animation player editor:

Animations in Godot

Move the editor cursor by the end to clicking below:

Animations in Godot

Change the logo position to (118,0) and add a keyframe again. With two keyframes, the animation happens.

Animations in Godot

Pressing "Play selected animation from the start (shift-D)" on the animation panel will make the logo descend.

Animations in Godot

Click the "Autoplay on Load" button to set the animation to start automatically when the scene begins.

Animations in Godot

At last, when running the scene, the animation should look like this:

Animations in Godot
Animations in Godot
Next TopicFile system




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA