- Home /
After 180deg turn animation, char is at ~160
I have a default idle state, which transitions into an idle which turns 180deg and walks. In the animator the transition from idle to the turn clip works perfect, showing the character blending from idle to turning 180deg and walking, but ingame, when the turn clip is done the character is not facing the opposite way, maybe like 160deg or so. I made sure the blending is over before the actual turn has started.
$$anonymous$$ight help if you said how it was set up ($$anonymous$$echanim? Some tracking button checked set?)
Using plain animation (the old system,) animation will never change the actual facing (the blue arrow.) And, it will always be perfectly positioned as in the last frame (unless the blend time is longer than the animation.) So something else is chopping yours short.
I thought it was the blending that caused this. So some of the rotation would be lost blending from idle->turning and some more will be lost turning->walking. You've ruled out the first but maybe it's happening in the second transition?
You might want to check out Animator.$$anonymous$$atchTarget. This allows you to specify the exact rotation you want to achieve at a given point during the animation.
Answer by apomarinov1 · Nov 30, 2013 at 06:16 AM
I guess I`ll answer that because I managed to get what I need. How I did it:
I made two sets of clips: one for turning to the right and one to the left
Used an AnimationEvent to tell the turn to transition to Walk
The key was that all the clips in the sets had to be "similar" i.e. the first step to be at the same time across all. Then I chose a time for the event. In the clips for turning left I chose a time after the turn and when the right foot is off the ground. For the other set at the same time not the right but the left foot is off the ground, because the clips are mirrored, so I set the event in the next step where again the right foot is off the ground(which makes the clips from this set a little longer), that way both sets could transition to a single Walk.
I used this approach because I wanted the character to turn to the way the camera is facing and keep walking that way. The result was almost perfect with just a little difference in the Y rotation of the character which I correct from script.
Your answer
Follow this Question
Related Questions
Rotate and run animation difficulties - Please help:) 1 Answer
How to play character turning animation when the camera rotates s certain degree like in fornite 1 Answer
AddMixingTransform with Mecanim 1 Answer
Add more bones to skeleton - vertebraes definition...? 0 Answers
How to create a 2D rig? 1 Answer