I just have finished rigging my first character. After all these years, only now I got the courage to touch this topic qhich sounded quite complicated to me.
So it was quite a revelation to find out rigging is nowhere near as bad as I heard, and actually Blender proved to be much better to use for rigging than I feared. So far everything was quite smooth sailing if you disregard the fact I spent a lot of time learning the whole rigging process (and going in to fix some stupid newbie mistakes).
This is where I am now:
[attachment=32202:character_rig.png]
Disregard the many bones for pouches and Stuff... I will try to animate them from script, and besides struggling with python driver in Blender, I think I should be set with Unitys C# (if the many bones to transform will be performant enough IDK yet).
Also disregard my ignorance for giving the control bones a different shape. Ugly rig, I know. I will rectify it later.
My main problem at the moment is how to parent the rifle to the Hands, and how to make the character aim with it.
Because this might be important: I have IK chains for both arms, upper and lower arm. The shoulder is not included in the IK chain (seems to be better to position it by hand), the hands are not included. Besides IK chains for the legs, there are no other IK chains (yet).
1) How to parent Rifle to hands:
I have successfully parented the rifle to the character right hand. Positioning the rifle in the hand and bending the fingers correctly was a slight pain, so I hope to find a solution that will save me the exact parenting and hand bone positions.
Anyway. I had some success creating a short idle animation with the rifle parented to the right hand, and the left hand parented to the rifle.
I was able to shift the position of the rifle slightly without the hand positions going haywire (though I might have had to slightly adjust the roll, pitch or ywa of the left hand as only the arm (IK enabled under arm bone) was parented to the rifle.
Now, I had to go in and fix some errors on the hand rigs. To do that, of course I had to bring the character into a neutral position. And for that, of course I had to disable the parenting of the left arm to the rifle.
After re-enabling the parenting, the arm has lost the exact position I set it to, had to redo all the positioning again.
Is there a better was to handle two handed objects like that? How to parent it correctly, so it could be left parented to either hand while the other hand does something different (cycling a round, reloading, grabbing a grenade from the belt, whatever)? How to enable the rifle not being parented to any hand (for example when the character throws it away for close combat), while being able to return to the parenting afterwards?
Is it a better idea to separate the Rifle into its own mesh object? (might be needed for example if it should receive a rigidbody and use physics when being thrown away for example)
2) How to make the chracter aim from script:
I would like the character to be adjusting his aim without having to turn the character for aiming. I am not fond of the old "floating characters" where the dev saved on animation frames by simply turning the character mesh without any kind of animation. Also, I think it would look more realistic if the character wouldn't move his leg just for a slight adjustment in aim, but would turn his torso instead.
How can Achieve this without breaking the rig for use without holding the rifle in its hand? I have thought about an additional IK chain involving rifle, arms and torso, but given how floppy the IK chains react, IDK.
Would it be best to create an ik chain for the torso, have a control bone aligned with the rifle muzzle, and use that control bone to aim the rifle (turning the torso with it)? should I rather use a lookAt boneConstraint?
I guess I can just turn its influence down to zero when not in use... is there a way to "group" mutliple contraints and IK chains so I can deactive/activate them on the flip of a (C#) switch in the game engine?
Thanks for any help... I am kinda at the limit of what I could achieve just with tutorial vids and experimenting (should I have gone with a simpler rig first... hell yes! But then, just because you know something is stupid doesn't mean you can dodge that bullet :))
Gian-Reto