- Home /
Mecanim clips transition options
Hi there, I'm using Mecanim in Unity 4.1.2f1. I have one animation clip for running forward. I want to make running backward also using this clip by setting it's speed to -1 (it looks ok).
To make perfect transition between these clips I need to fulfil the following: if at the moment of transition we have the normalized time of running forward clip equal to (1/n) then we must transit to normalized time of running backward equal to (1 - 1/n) (and vice versa).
Can I somehow realize this scenario by means of Unity Editor or is the only way to do it is setting normalized time from script?
You may be overthinking it. Are you able to make the backwards-running clip a separate animation? If so, then you have two animations and mecanim will blend them together, with I assume an idle clip.
I may be confused as to what you're asking, however. But if the transition is so fast, like the character is running forward and then almost instantly starts running backward, then no amount of blending will make it look THAT perfect, since blending requires time.
Thank you for your answer.
Yes, transition need to be almost momentary. I really don't need real blend in this situation. But I don't know how I can realize the described above scenario, so I thought mabe transition options allow to make this.
Do you know any way of implementing this kind of transition? $$anonymous$$aybe by scripting?
Thanks in advance...
I've attempted to use animator.ForceStateNormalizedTime() but it did not help a lot because is can be used only for setting normalized time of a state, but to reach the state we must make transition to it first. And even if transition is adjusted to by very short in editor it still transfers us to fixed frame (as was set in it's settings).
Well, $$anonymous$$ecanim should do all that work for you. If you pass a variable, such as "velocity" to mecanim, and set "run forward" to +1 and "run backward" to -1 (with "idle" at 0), then make sure that when the player is pressing "up" or what not, velocity = 1 and when they're pressing "down" (or "back" or however you set up your controls) then velocity = -1, mecanim will take care of the rest.
I'm figuring you want immediate reverse with the foot placement exactly the same right? Can't you have a non-atomic, zero length blend with ForceStateNormalizedTime?
(Thinking that non-atomic blends do not enforce a particular frame)
Your answer
Follow this Question
Related Questions
Mecanim mysterious curve 2 Answers
Unity 5.2: Mecanim Transition Blending 1 Answer
Combining two animations to be one 0 Answers