- Editado
Loop animations one frame before the animation end?
I have a lot of looping animations on my characters, but if I have an animation that starts and ends with the same frame, there are two identical frames playing when a loop occurs. While not that noticeable directly, the flow of the animation becomes a bit off. Is there a way to end an animation on a different frame than the full animation?
Doing this in the Spine Editor by making a new end frame is very time consuming and annoying, since you have to redo the last frame each time you make a small adjustment. I have seen other animations be able to cut at an arbitrary point, but I have not found this in the Spine Runtimes; maybe I'm missing something?
This is actually not true. Spine isn't frame-based so its dopesheet can be a bit misleading, since it does show "frames" and vaguely looks like Flash's dopesheet, which is frame-based. So the double-frame thing does not happen as it would in, for example, a Blender or AfterEffects or Flash export.
Spine is comprised of keys with times, and everything is interpolated to whatever fraction of a second your game engine lands on in each game update. In fact, it will rarely land on the dopesheet frames exactly. This is why you will see poses in-game or in playback that you may not necessarily see on the discrete "frames" where the dopesheet cursor snaps to.
In other words, even if we wanted to "loop animations one frame before animation end", the definition of "one frame" is sort of nebulous and we can arbitrarily pick "based on 30fps" and it will likely not solve any of your problems.
If you loop your animation in Spine Editor, and you loop it in your game, it should look the same. If it doesn't, let us know. We can try to debug that.
It's more likely that the flow of your animations looks off because of curves rather than because the start and end key poses are the same.
If you open the sample skeletons, the start and end keys are the same poses and those should not have any hitches since they were tested and animated to check for that.
Yeah, you're absolutely right. I must have jumped to conclusions since I've had this "problem" with other animation tools. My animation looked "smoother" when I skipped the last frame in the Spine Editor, but I guess my curves are slightly off as you said, since I took a look at the examples and they looked fine as well as some of my other animations after taking a closer look.
Thank you for your time and answer.