Weapon attach to player

Hi can anyone please tell me how i can make when player choose between weapons the weapon got attached to the hands of the player.

Do i need to make the whole character with the weapon in the modelling program or do i only need to do the arms with the weapon and then add it to the player as a child object. Or is there any way to add the weapon to the player and make the player hold the gun.

You would need to model the weapon either with the point it should be attached to the player’s hand at the origin or you would need to make a bone for the attachment point and position it relative to that. Then parent the gun to the player as Posly suggested, although you’ll have to parent it to the specific bone transform it is intended to be attached to (right or left hand probably). In the case of two-handed weapons I would think you would need different sets of animations and to have some script assigned to each weapon that defines what type of weapon it is and what animation set it uses.

You can set the guns parent as the player with “transform.parent = player.transform”, just make a var with player as a transform.

But that will not make the hand animation be good on the gun i mean if i use a gun the hand animation have to change when you change to a ak 47.

Another way to solve this, more simply, is to you model the arms animation with the gun already attached. I mean, if you have 5 types of weapon, you should create 5 arms models with their respective weapons already attached. So when you choose a weapon, all you have to do is to reload the respective animated model model and trigger the “Fire” or the “Reload” animation points and thats it. Of course, tou can create bones and all kinds of complicated things… Personaly I don´t know wich way has better performance or cost.

I thinked like this i make a player and cut of his arms and then add to the weapon its own arms That Will be attached to the player. But the problem is That egen i Will make the pickup system how Will i make the dropped weapon without arms and when you attach it it gets arms. Also a model on the ground and another when you pick it up.

Ok i got a new idea can anyone Tell me if its got idea or not. The idea is to make the character without arms and then make the weapon with the arms and then attach the Both in unity. But the problem is when i want to add a pickup system and then the player drops his Gun it Will not be good to see the Gun with the arms dropped. And note this Will be a multiplayer game. But can anyone Tell me if you search at elite squade game update 16 at youtube you Will find a game Made in unity can anyone Tell me which way they use at attaching weapon.