- Home /
Animation (Turning) starts from original rotation
Hello,
I have a turn Animation that does a 180 degrees for example to the left, however when I play this rotation I would like it to play 2 times meaning it does a full 360 degree turn, the problem is, the 2nd play starts the "turn" from the original position the character was staying in before it did the 1st turn, so it literally ignores its current rotation and starts over...
I am trying to use Legacy animations, or Generic whatever works best I guess, I've went down the path of Mecanim but decided that is not something I want to pursue, please let me know how to make the character continue the "animations" of where it left off not of where it was animated in the X,Y,Z axis... seems to reset on any animation I believe,
thanks
edit: I just realized the "character" actually does not rotate in unity it stays 0,0,0 even though it is turning... I've tried setting the root transform rotation, position etc.
Edit: I am trying to accomplish the same type of character controller such as the Mecanim Teddy Bear NavMesh demo scene, turning, walking, running etc.
Best is $$anonymous$$ecanim :). I can help you there, but not in the legacy
The only problem with $$anonymous$$ecanim is that your animations have to be animated as if the character was "walking" /running etc, however my animations were done in a static position...
You don't have to animate the character to be moving while walking / running, to be able to animate them in $$anonymous$$ecanim You can do them in static position as well. I am currently developing a game and i have both ways of animations and it works great...
Oh, so how does $$anonymous$$ecanim make the character "walk" ? I'm still trying to understand this and there isn't much information to go on for
You can have 2 ways. First: $$anonymous$$ake the character Walk / Run by moving forward, then in Unity you just set it up in a way, so the character controller moves with the animations, that the rig have when it was imported. Second way: Animate Walk / Run on place and then in Unity you set it up, so the character is walking / running on place and you script the forward movement, this way you only have to adjust the speed of the movement, so your character's feet doesn't slide. Both ways have their up's and down's, though i think the first way is better, because you can still adjust the speed of the movement, by changing the clips speed and you'r character will never slide on the ground...
Answer by Gooey-Man · Mar 13, 2014 at 02:38 AM
Your animation just replays over and then again. You can't tell it to add a certain amount of degrees but just to start, fade, and finish. You have to make another animation that turns a full 360.
so that is the reason we need to use $$anonymous$$ecanim ??? because in $$anonymous$$ecanim it just adds to the rotation....?
$$anonymous$$ecanim doesn't work that way. It only blends animations together not positions. Even if you were using two animations as key frames (one at 0 degrees and one at 180 degrees) mecanim would have no way of knowing which direction to turn toward when blending between the two. This would probably result in some strange behavior or it would rotate left 180 degrees then back right 180 degrees or right 180 degrees then left 180 degrees. If all your doing is a turn table to display your object the best way to do that is to use the animation window in unity or a 3rd party application like blender if its a model then loop the animation.
What I am actually trying to do is copy the exact same "Nav$$anonymous$$esh Teddy Bear demo scene" basically, forward, turn, etc. but my animations were done in Cycle animations not progressive, so I don't understand how to accomplish this, by the sounds of it I don't understand how the $$anonymous$$ecanim system works neither
Oh okay, the Nav$$anonymous$$eshAgent component is handling the actual movement of the character. While animation is handled by mecanim. So you have to use the Nav$$anonymous$$esh system or create your own script to handle the actual movement of the character in world space.
We disable the rotation and update the walk/rotation from the mecanim itself, i believe there is a Synch script included or something like that that disables navmesh from rotating the character & moving it, it just allows the destination and other things to be set
Your answer
Follow this Question
Related Questions
Legacy vs. Generic vs. Humanoid pros and cons? 1 Answer
Animation won't play as Generic but it does as Legacy, I need to use Generic, how can I fix this? 2 Answers
i get weird rotations on my animated objects using legacy, help? 0 Answers
A node in a childnode? 1 Answer
Animations messing up character 0 Answers