0 votes

Hi, I'm having a hard time deciding what is the best way to correctly animate my character:
I have the different animations (Idle, Jump, WhileJumping, Hurt, Die) in different files, now I have two ways to do the animation:

  1. Using an AnimatedSprite with all the animations in it and then change them by script
  2. Using the AnimationTree with the AnimationPlayer

My problem is that I want the character to be collidable when the jumping animation is almost ended.

If I use the AnimationPlayer is easy to do this because the editor can edit the single frame at that single time with property keys, but the drawback is that the AnimationPlayer can only have a single Sprite as reference.
So if I want to use it I must create a Sprite for every animation that has to be hidden or not. (Is this right?)

Otherwise if I want to use an AnimatedSprite, I can just load all different animations and then, by code, change the .play() with the animation I want but I will not have the same precision about editing the collision area during the execution of the animation.(Is this right?)

So what is the best to use? Suggestions?

Godot version 3.5.1
in Engine by (15 points)

1 Answer

+1 vote
Best answer

I think you should use Animation Player and AnimationTree, because AnimationTree is very flexible when you have a lot of character states and you need to create a whole system. You can, for example, create a sequence of animations, or make a playback condition only when the previous one has ended. Its need to work on this. But if that's what you need, then the code will be more difficult

by (86 points)
selected by

Yes that was the best way. I succeded to accomplish what I wanted to do.
The real problem was just to unite the different sprite sheets in one single sprite sheet, then use the AnimationPlayer and AnimationTree to change animation and settings character properties like hitboxes and hurtboxes. Thanks for the reply.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.