0 votes

What I want to do seems like it should be extremely simple. I want to make my Running and Jumping animations play all frames, then loop between all frames except the first.

1,2,3,4,5,6,7,8 > 2,3,4,5,6,7,8 > 2,3,4,5,6,7,8

I don't know how there are numerous tutorials for 2D Platformers and none of them have even TOUCHED on this basic concept. I have been searching for days and haven't been able to find ANY relevant information ANYWHERE to the point I'm near ready to give up.

in Engine by (15 points)

1 Answer

+2 votes
Best answer

I don't know if it's possible to do exactly as you describe, but you can just make two separate animations the first plays 1 and the second looping 2 through 8. Then connect the animationfinished signal to a function that plays the second animation if the animationfinished string == the name of the first animation.

by (552 points)
selected by

A word of warning: if I recall correctly the animation_finished signal is emitted as soon as the last frame of the animation is displayed, not after it has been displayed for as much time as the animation framerate implies. To avoid "skipping" the last frame when switching animations using animation_finished, you can add a blank dummy last frame, or use a timer to control the animation switching instead. I could be wrong about this, it's been a while since I used animation_finished, so ymmv?

The two of you collectively have pulled together ideas that have helped me greatly.

I've seperated the animations into two warmup and looped sets. The warmup sets have dummy frames to make them last longer, and each have been assigned timers to extend and shorten the frames.

Getting back to it now. Thank you both very much!

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 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 webmaster@godotengine.org with your username.

Categories