Is there an easier way to edit animations for nodes added at runtime?

Godot Version

4.2.1 stable


I have a 2D character using an AnimationPlayer.

I’m trying to implement attacks/abilities which can be equipped/swapped by the player. I have a resource class Ability. It has a PackedScene containing the ability’s behavior and which may or may not have internal children, such as collision boxes for attacks. The Ability resource also contains an AnimationLibrary containing any ability-specific animations which rely on the ability’s scene.

When the ability is “equipped” the scene is instantiated and added to the character and the AnimationLibrary is added to the AnimationPlayer. When it is “uneqipped” the scene is freed and the library is removed.

This system works as-is, but it’s a huge pain to actually create or edit the animations since the ability’s scene and animation are saved as separate resources. The main issues I’m running into are that you can’t edit animations unless they are inside an AnimationPlayer and you can’t add animation tracks for internal nodes or nodes which are not part of the current scene.

Every time I want to add or change any animation, no matter how small the change, I have to add the ability scene and animation library to my character and enable Editable Children on the scene first. Then I can make the change. Then I have to go and delete everything since it’s not actually supposed to be there yet. And I have to make sure to not accidentally hit the “Delete animation tracks” button when I delete the scene.

It’s not that bad but it’s tedious enough to make me less excited about making and especially fine-tuning potentially dozens more abilities.

I feel like I must be missing something obvious about the animation system and tools. Is there a better way to do this?

1 Like