- Home /
Have one animation segue into another
Hello,
I'm trying to build a 2D platformer with 3D assets. Here's the problem I'm running into. Basically, what I need is to have an animation that can be used as a transition between one clip and the next.
For example, let's say the character is in a "kneeling" stance. If the right key is pressed, he goes into the "crawling" animation loop. But I want to play an animation that will take him from "kneeling" to the first frame of "crawling". In essence, an animation of him going on all fours.
I was thinking the proper way to do so would be to have a script that says "when the key is pressed, play the transition animation and then play and stick to the "crawling" loop." I'm just learning javascript though, so I'm not sure if that's even the right way to look at it. Any help would be appreciated.
Thank you.
Answer by Loius · Oct 17, 2010 at 05:04 PM
Take a gander at the ...Queued functions of Animation, then try-
CrossFade("walkToCrawl");
CrossFadeQueued("crawl");
Sorry to reply so late. Had to put this down for a long while before I could try it out. Thank you very much for your answer. Showed me exactly the way I need to go about tackling this.
Answer by Rasmus Schlnsen · Oct 01, 2010 at 01:57 PM
Not quite sure that this is what you're looking for, but have you checked out the Animation.CrossFade function?
Yes, but all that would do is a blend between the "kneeling" and "crawling". Ins$$anonymous$$d of relying on that blend, I want to use a specific animation. Is that possible?