mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 19:29:06 +00:00
Remove merge from scene from your first 3D game
(cherry picked from commit 16f06a9277)
This commit is contained in:
@@ -245,16 +245,10 @@ node structure, you can copy them to different scenes.
|
||||
For example, both the *Mob* and the *Player* scenes have a *Pivot* and a
|
||||
*Character* node, so we can reuse animations between them.
|
||||
|
||||
We're going to duplicate the animation using a feature called "merge from
|
||||
scene".
|
||||
|
||||
Open the *Mob* scene, right-click on the *Mob* node and select *Merge From
|
||||
Scene*.
|
||||
|
||||
|image23|
|
||||
|
||||
Double-click ``Player.tscn`` to open it and import the *AnimationPlayer*. That's
|
||||
it; all monsters will now play the float animation.
|
||||
Open the *Mob* scene, select the animation player node and open the float animation.
|
||||
Next, click on *Animation -> Copy*. Then Open ``Player.tscn`` and open its animation
|
||||
player. Click *Animation -> Paste*. That's it; all monsters will now play the float
|
||||
animation.
|
||||
|
||||
We can change the playback speed based on the creature's ``random_speed``. Open
|
||||
the *Mob*'s script and at the end of the ``initialize()`` function, add the
|
||||
@@ -562,4 +556,3 @@ And the *Mob*'s script.
|
||||
.. |image20| image:: img/09.adding_animations/19.ease_in_second_translation_key.png
|
||||
.. |image21| image:: img/09.adding_animations/20.float_animation.gif
|
||||
.. |image22| image:: img/09.adding_animations/21.script_icon.png
|
||||
.. |image23| image:: img/09.adding_animations/22.merge_from_scene.png
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB |
Reference in New Issue
Block a user