- Home /
Mirror animation (mecanim)
I m following mecanim video tutorial Unity 4.0 - Mecanim Animation Tutorial
Animation pack i downloaded does not contain one of the animations used in this tutorial (WalkBackward_TurnLeft).
AngyAnt wrote: One of the features of mecanim is easily mirroring animation. This is how you should achieve a left animation based on a right animation. And that is why this package does not contain both.
"Why would you do it like that? That's stupid." Because the resulting player will only contain one copy of the animation asset in stead of two. Storage and memory gained by the tick of a button.
I dont understand how do i do this. I v noticed "mirror" checkbox but i dont know how to get two instances of this animation where one is mirrored and other is not.
EDIT1: i referenced both motions (for right walking and left walking) to WalkBack_TurnRight animation, and in one of them (supposed to be left motion) i checked "mirror" checkbox which means this one should invert TurnRight into TurnLeft, right ? But this does not happen, i just get TurnRight motion.
EDIT2: Ah i got it, partly, i mirrored motions sucessfully i got left motion from right motion. I just thought it does not work because when i would use slide bar on the "blend tree" (element which connects all motions) to adjust direction, the motions would not switch properly. I m goin to see what could i be doing wrong there
Joakim
Answer by Joakim · Jan 30, 2013 at 09:13 PM
This is the way I sucessfully mirrored animations:
For example, lets make WalkForwardLeft animation from the WalkForwardRight animation. In fact, we need to make clips, one clip for each of those.
Similar procedure can be seen in tutorial at 17:00 - 21:00.
First, we take "WalkForwardTurnRight_ntrlMedium" clip which is avalible in unity (if you download mecanim), or we take any other "WalkForwardTurnRight_whatever" clip. Now, we need to make 2 new clips (WalkFLeft and WalkFRight) from this clip. We can't use this default clip for "WalkForwardRight" because it is not looping properly (seems most of the clips are not looping properly). So, first we make proper "WalkFRight" clip (with a nice loop) as shown in tutorial . After we did that, we make another new clip identical to "WalkForwardRight" but we name it "WalkForwardLeft" and check "mirror" checkbox.
Now we have original "WalkForwardTurnRIght_whatever" clip and 2 new clips which are identical but one of them has "mirror" checked and is called "WalkForwardTurnLeft" while other one is called "WalkForwardTurnRight" and does not have "mirror" checkbox checked.
Now we have usable walkForwardRight and walkForwardLeft clips : ).
Joakim
I was also looking for the way to do this, I couldn't find any information in the manual. Thanks a lot!