@@ -56,17 +56,15 @@ nodes.
56
56
57
57
Set the animation duration to ``1.2 `` seconds in the top-right of the dock.
58
58
59
- |image7 |
60
-
61
59
You should see the gray ribbon widen a bit. It shows you the start and end of
62
60
your animation and the vertical blue line is your time cursor.
63
61
64
- |image8 |
62
+ |image7 |
65
63
66
64
You can click and drag the slider in the bottom-right to zoom in and out of the
67
65
timeline.
68
66
69
- |image9 |
67
+ |image8 |
70
68
71
69
The float animation
72
70
-------------------
@@ -82,23 +80,23 @@ rotation of the ``Character`` node.
82
80
83
81
Select the ``Character `` and in the *Inspector * expand the *Transform * section. Click the key icon next to *Position *, and *Rotation *.
84
82
85
- |image10 |
83
+ |image9 |
86
84
87
85
.. image :: img/09.adding_animations/curves.webp
88
86
89
87
For this tutorial, just create RESET Track(s) which is the default choice
90
88
91
89
Two tracks appear in the editor with a diamond icon representing each keyframe.
92
90
93
- |image11 |
91
+ |image10 |
94
92
95
93
You can click and drag on the diamonds to move them in time. Move the
96
94
position key to ``0.3 `` seconds and the rotation key to ``0.1 `` seconds.
97
95
98
- |image12 |
96
+ |image11 |
99
97
100
98
Move the time cursor to ``0.5 `` seconds by clicking and dragging on the gray
101
- timeline.
99
+ timeline, or by entering it into the input field .
102
100
103
101
|timeline_05_click |
104
102
@@ -108,7 +106,7 @@ In the *Inspector*, set the *Position*'s *Y* axis to ``0.65`` meters and the
108
106
If you don't see the properties in the *Inspector * panel, first click on the
109
107
``Character `` node again in the *Scene * dock.
110
108
111
- |image13 |
109
+ |image12 |
112
110
113
111
Create a keyframe for both properties
114
112
@@ -117,7 +115,7 @@ Create a keyframe for both properties
117
115
Now, move the position keyframe to ``0.7 ``
118
116
seconds by dragging it on the timeline.
119
117
120
- |image14 |
118
+ |image13 |
121
119
122
120
.. note ::
123
121
@@ -136,7 +134,7 @@ create a key for both properties.
136
134
You can preview the result by clicking the play button or pressing :kbd: `Shift + D `.
137
135
Click the stop button or press :kbd: `S ` to stop playback.
138
136
139
- |image15 |
137
+ |image14 |
140
138
141
139
You can see that the engine interpolates between your keyframes to produce a
142
140
continuous animation. At the moment, though, the motion feels very robotic. This
@@ -147,33 +145,33 @@ We can control the transition between keyframes using easing curves.
147
145
148
146
Click and drag around the first two keys in the timeline to box select them.
149
147
150
- |image16 |
148
+ |image15 |
151
149
152
150
You can edit the properties of both keys simultaneously in the *Inspector *,
153
151
where you can see an *Easing * property.
154
152
155
- |image17 |
153
+ |image16 |
156
154
157
155
Click and drag on the curve, pulling it towards the left. This will make it
158
156
ease-out, that is to say, transition fast initially and slow down as the time
159
157
cursor reaches the next keyframe.
160
158
161
- |image18 |
159
+ |image17 |
162
160
163
161
Play the animation again to see the difference. The first half should already
164
162
feel a bit bouncier.
165
163
166
164
Apply an ease-out to the second keyframe in the rotation track.
167
165
168
- |image19 |
166
+ |image18 |
169
167
170
168
Do the opposite for the second position keyframe, dragging it to the right.
171
169
172
- |image20 |
170
+ |image19 |
173
171
174
172
Your animation should look something like this.
175
173
176
- |image21 |
174
+ |image20 |
177
175
178
176
.. note ::
179
177
@@ -197,7 +195,7 @@ Let's change the animation speed when the character is moving.
197
195
198
196
Open the ``Player ``'s script by clicking the script icon next to it.
199
197
200
- |image22 |
198
+ |image21 |
201
199
202
200
In ``_physics_process() ``, after the line where we check the ``direction ``
203
201
vector, add the following code.
@@ -618,26 +616,25 @@ And the *Mob*'s script.
618
616
.. |image0 | image :: img/squash-the-creeps-final.gif
619
617
.. |image1 | image :: img/09.adding_animations/animation_player_dock.webp
620
618
.. |image2 | image :: img/09.adding_animations/02.new_animation.webp
621
- .. |image3 | image :: img/09.adding_animations/03.float_name.png
622
- .. |image4 | image :: img/09.adding_animations/03.timeline.png
623
- .. |image5 | image :: img/09.adding_animations/04.autoplay_and_loop.png
624
- .. |image6 | image :: img/09.adding_animations/05.pin_icon.png
619
+ .. |image3 | image :: img/09.adding_animations/03.float_name.webp
620
+ .. |image4 | image :: img/09.adding_animations/03.timeline.webp
621
+ .. |image5 | image :: img/09.adding_animations/04.autoplay_and_loop.webp
622
+ .. |image6 | image :: img/09.adding_animations/05.pin_icon.webp
625
623
.. |image7 | image :: img/09.adding_animations/06.animation_duration.webp
626
- .. |image8 | image :: img/09.adding_animations/07.editable_timeline.webp
627
- .. |image9 | image :: img/09.adding_animations/08.zoom_slider.webp
628
- .. |image10 | image :: img/09.adding_animations/09.creating_first_keyframe.webp
629
- .. |image11 | image :: img/09.adding_animations/10.initial_keys.webp
630
- .. |image12 | image :: img/09.adding_animations/11.moving_keys.webp
631
- .. |image13 | image :: img/09.adding_animations/12.second_keys_values.webp
632
- .. |image14 | image :: img/09.adding_animations/13.second_keys.webp
633
- .. |image15 | image :: img/09.adding_animations/14.play_button.png
634
- .. |image16 | image :: img/09.adding_animations/15.box_select.webp
635
- .. |image17 | image :: img/09.adding_animations/16.easing_property.png
636
- .. |image18 | image :: img/09.adding_animations/17.ease_out.png
637
- .. |image19 | image :: img/09.adding_animations/18.ease_out_second_rotation_key.png
638
- .. |image20 | image :: img/09.adding_animations/19.ease_in_second_translation_key.png
639
- .. |image21 | image :: img/09.adding_animations/20.float_animation.gif
640
- .. |image22 | image :: img/09.adding_animations/21.script_icon.png
624
+ .. |image8 | image :: img/09.adding_animations/08.zoom_slider.webp
625
+ .. |image9 | image :: img/09.adding_animations/09.creating_first_keyframe.webp
626
+ .. |image10 | image :: img/09.adding_animations/10.initial_keys.webp
627
+ .. |image11 | image :: img/09.adding_animations/11.moving_keys.webp
628
+ .. |image12 | image :: img/09.adding_animations/12.second_keys_values.webp
629
+ .. |image13 | image :: img/09.adding_animations/13.second_keys.webp
630
+ .. |image14 | image :: img/09.adding_animations/14.play_button.webp
631
+ .. |image15 | image :: img/09.adding_animations/15.box_select.webp
632
+ .. |image16 | image :: img/09.adding_animations/16.easing_property.webp
633
+ .. |image17 | image :: img/09.adding_animations/17.ease_out.webp
634
+ .. |image18 | image :: img/09.adding_animations/18.ease_out_second_rotation_key.webp
635
+ .. |image19 | image :: img/09.adding_animations/19.ease_in_second_translation_key.webp
636
+ .. |image20 | image :: img/09.adding_animations/20.float_animation.gif
637
+ .. |image21 | image :: img/09.adding_animations/21.script_icon.webp
641
638
.. |animation_final_keyframes | image :: img/09.adding_animations/animation_final_keyframes.webp
642
639
.. |second_keys_both | image :: img/09.adding_animations/second_keys_both.webp
643
640
.. |timeline_05_click | image :: img/09.adding_animations/timeline_05_click.webp
0 commit comments