If I were to have multiple weapons for a character, I assume I would make separate reload/ switch weapon animations so that the hand positions would align to each weapon. My main concern is how should this be done, or how would you recommend me to do this?
Also, when I attach a main camera to the character, should I make sure the character’s “Idle” animation doesn’t make the upper body move too much, since the player would constantly get, in a sense, sea-sick from the view going up and down (faking breathing/movement)?
Make a special bone/joint in your character for the weapon.
Attach weapons to that weapon-bone in game using scripts; and attach weapons to that weapon-bone in modelling tool, so you can make correct animations;
Make separate animations for each weapon class (rifles, pistols and so on)
Play appropriate animations in game, based on which weapon is selected
People usually make a special joint for camera, so you can animate it less than the head (or whichever joint you’re attaching your camera too). Actually a lot of people choose to have separate animations for 1st person and 3rd person, but in any way a special joint is the way to go!
Ok, I know this reply is very delayed, but I tried to get extra help elsewhere. I understand the principles behind what you said, but I have more questions:
Do I have to make joints on the weapons so they connect correctly to the hands of the character? And could you give a script example of attaching/ detaching weapons to the bones?
Judging from what you wrote prior, I don’t think I have any other questions… hopefully that’s the way it’ll stay.
No, you shouldn’t need any joints on the weapon. Just attach/parent your weapon to that special joint on hand or to the hand itself (in runtime).
If you want to do it plain simple - just attach your weapon to the hand, but that means that you will probably have fixed position on the hand. I suggested adding special joint on the hand to which weapon can be attached, because that allows animate that joint, i.e. allows you to control position of the weapon relative to the hand in your modelling tool.
// attaching
weapon_GameObject.transform.parent = handBone_GameObject.transform;
// setting local position
weapon_GameObject.transform.localPosition = positionOfMyWeaponRelativeToTheHand;
Yeah, so I just tried it. Seems like I will have to actually set the gun’s position by hand, unless I can perfectly align a bone so that the weapon looks like it perfectly rests in the hand…
fps is harder than i though when using a real character.