- Home /
Mechanim: Sprite animation transitions
I'm using Mechanim to control spritebased frameanimations. That's animations where the sprite changes each frame.
I'm currently doing transitions by making a separate state for the transition, like this:
[ Animation "A" ] ---EmptyTransition---> [Animation "A-to-B-transition"] ---EmptyTransition---> [ Animation "B" ]
This is because I don't know how to make Mechanim's transitions to swap sprites. An ideal flow would be more like this:
[ Animation "A" ] ---TransitionPlaying[Animation "A-to-B-transition"]---> [ Animation "B" ]
Is this by any means possible?
Any ideas or thoughts are most welcome :-) Thanks in advance!
I don't know where your problem is. If you have a sprite sheet and create multiple animation clips from it, and assign these clips to the animation states of your animation controller, it should be no problem transitioning between states. Read the User $$anonymous$$anual for the animation system if you haven't already.
I’m very sorry, if I wasn’t clear in my question. But let’s say I have the following sprites:
idle0
idle1
idle2
idle3
idle4
idle5
idle-to-jump0
idle-to-jump1
idle-to-jump2
jump0
jump1
jump2
jump3
The idle-cycle plays. Then the player hits jump. Now I want to play 3 idle-to-jump-sprites and after that play the jump-cycle.
So the idle-to-jump sprites is a transition. How do you use $$anonymous$$echanim’s transition-functionality to play this transition? Is this possible?
Please let me know, if there are any details I should be more precise on. Any help would be valued! :-)
First of all, of course all three animations have to be animation clips, I assume that's clear. So to go from idle state to idle-to-jump-state (and further to jump state), make the transition have an exit time of 1.0, this way the idle-to-jump animation will play completely before transitioning to the next (jump) state.
Your answer
Follow this Question
Related Questions
Exit Mecanim State After Exit Time Or With Interruption And Exit Time 1 Answer
How do I check, and change, the current frame/time of a sprite animation in Unity 4.3? 0 Answers
Change mecanim transitions via script 0 Answers
is it possible to read states / transitions from mecanim in runtime ? 1 Answer
Altered Mecanim parameters reset the current state back to the default state. 0 Answers