So this is what I got, I have a character (a man) that has a running animation and is animated from the legs all the way to the head. What I want to do is have the torso rotate faster than the legs when aiming. If I rotate the whole character (which is possible) it just looks unnatural.
The problem is, that I can’t rotate it unless I turn off the animation, which I don’t want to.
Any tips?
I tried searching this forum, but most answers were really unclear and were mostly theory that I did not even know how to apply.
Thanks.
EDIT: I took a look at the locomotion project but I don’t even know where to look.
is all of this animation done in unity animation system or in 3rd party application and imported? If everything was done in unity animator, I guess you will have to make it seperate animations, maybe placing everything from the torso and up in a seperate game object to give seperate control. I hop eI understood you correctly…
Export is as an FBX file with baked animation. I think you did understand me just right.
I’m going to try your suggestion even though I didn’t do the animations with unity.
EDIT: I tried making a new game object, and putting the bones of my torso in it. It works, I can rotate it around while the legs are still animated. But there is a huge problem, my character looks all distorted and is placed in weird angles. When I use the mouse-look script it doesn’t look at the mouse, it just spins in a weird angle.
You can use the HeadLookController to achieve what you described. Also you should know that animation is updated between Update and LateUpdate. Any adjustments you need to make to an animation can be made in LateUpdate.
I don’t know why but it doesn’t want to open with my unity, I get an error. Let me download it and try it again.
EDIT: ok it works now, I’m taking a look at it.
EDIT2:
Oh man I don’t even know what’s what.
I wish there was just a simple example that had two objects and have a basic script that showed the basic functions so I can build up on that.
When you export from max, you need to check the axis conversion settings in the exporter. Also, I suggest that you create an empty game object and place your imported prefab inside this empty game object without making ANY rotation changes to empty game object. just rotate the imported object so that it’s front points in the empty gameobject’s front (blue arrow) direction. Then apply your code to the empty gameobject and not the imported object itself. I find it is sometimes better working with unity empty game objects than applying to imported prefabs directly, but this depends if you can get the axis conversion to work…
I have to game objects, one named “upTorso” and the other “Legs”. I turn off their animation.
I put all my bones that belong to the upper body and lower legs accordingly.
When I apply the mouse look, or make rotation changes through code etc everything works fine.
However, when I turn on the animation that’s when things get weird. My legs are in a different spot, my body turns at a wrong angle etc. Any tips?
EDIT: Okay I got some things working, finally =D.
Well sort of anyways.
My legs are animated, and they can rotate. The torso can rotate as well, and also look down/up.
However the torso is not animated, even though I added animation to it.