Simple way to make different weapon poses?

I am currently animating my character. He will be able to hold a number of different weapons, These weapons all have slightly different sizes so the way they are held in his hands differse; A rifle would be held different than a submachine gun, and so on.

What is the best method to make the character model hold these different weapon models?

The most straightforward approach would be to make a pose for each different weapon inside the 3D modelling program and import those.

I wonder if there’s a more flexible way inside the Unity editor?
When I tried parenting the character’s hands to the weapon model the arms just get stretched with no regard for the bone structure or joints.

I aplogise if this does not help but the only way I could think about doing it would be to rig your character (using bones, biped etc..) then placing an empty game object where the hand needs to be. With this you may be able to rotate it to the empty game objects position. (Maybe LookAt will work? I am not sure) But if you find this code I would love to know the answer :)

2 Answers

2

Try parenting the weapon to the character’s hand. :smiley:

You can also try setting positions programmatically by the type of gun…

Yes of course I can parent the weapon to the characters hand - if it is a one-handed weapon like a pistol or a knife! The point of my question however is that BOTH hands need to be in specific places for each weapon. For a rifle, the right hand would be at the trigger and the left hand far forward gripping the handguard. For a submachine gun with a forward grip, the left hand would be nearer to the trigger and gripping the forward grip at a 90 degree angle, and so on.

I would look into Mechanim IK: Unity - Manual: Inverse Kinematics

This could allow you to programmatically set hand positions to where you want them on the weapon, but you probably need to use world-relative coordinates and not weapon-relative coordinates.

Yes, this looks like it would do the trick. Too bad it's Pro only, gotta start saving some money ;) Thanks!

Yes, that's what I'm gonna do for now. Thanks again.