Godot Version
4.4.1
Question
Hello everyone! I’d like to ask for some help with a doubt I have. Is it possible to add more than one Sprite Sheet to an AnimationPlayer, so I can use it in the AnimationTree?
The situation is that I have two Sprite Sheets: one containing the ‘Idle’ and ‘Walk’ animations, and another one containing the attack animations. However, I’m not sure how I could implement this additional Sprite Sheet to be used in the AnimationTree… Could someone shed some light on this? :’(
Should I add the second Sprite Sheet to the same Sprite2D that already has Idle and Walk? But how can I do that without losing the animations that are already set up?
Since you already use a Sprite2D to display your animations / sprite sheets, at the very first frame of your AnimationPlayer’s animations, you can simply add the “Texture” property of your Sprite2D, as well as it’s hframes and vframes so they match your given spritesheet dimensions and such, and change it out dynamically. That’s how I do it in my game as well, see:
Alright, so after creating the Attack animation, do I click on the Sprite2D and then on the key to add a new texture? And how do I assign the attack SpriteSheet to it?
Should I click on the Texture field and drag the Sprite Sheet there? Forgive my naivety.
Yes, you add the texture that you want, then you click on the little “key” icon next to it to add it as a new keyframe.