[SOLVED]
Hi all! 🙂
I'm trying to setup a player controller in Unity, mixing animators and code.
I have a pre animated 3D dude (from the asset store), with idle, walk and run animations. What I want to do is use the premade animation for the waist down, and let the player control the torso and arms with mouse and keys. Imagine you're about to walk the plank with your back unnaturally upright, and you can move the mouse left and right to rotate the spine in a Z axis, (i.e. leaning to the sides) and can lower or raise your arms, (or even bring them forward), with a different input, maybe Q/E or mouse forward/backward.
The thing is I'm trying to find documentation or tutorials for this, and all I can find are tutorial for fully animatin with the Animator component, and that's not what I want nor need.
How can I access specific parts of the armature in order to rotate them through code?
Here's the setup that I have:
It's a 3D character with an Animator, that has an AnimatorController with 3 animations, idle, walk, run.
The animations are controlled using the Animator's state machine through code, like animator.SetBool("run", cc.velocity.magnitude > minimumSpeed );
The armature has a gazillion bones. I deleted the animations points from the spine up, so only hip below is animated. Currently the model is walking around T-posing. The project is already setup to take (old input system) inputs with WASD and mouse, and the camera is setup to an almost fixed POV so the character moves around and rotates like in any fixed-camera game.