Setting up a Character Question.

Hello Guys.

So I’m making a Multiplayer First Person Shooter.

Currently I have weaponmodels with hands attached to them. My Player is a Sphere for test purposes. I also have a model of a soldier which I didn’t used until now.

Because my Game will be Multiplayer I want to set up a player with the weapon in his hands. This way I don’t need several models for the local player and the other players.

I could make it so that I import the weaponmodel to the soldier model and then model the soldier around it and also animate them both in one model. This way I had to switch the entire soldiermodel when I just switch weapon. This seems to be a lot of work and will probably cause a lot of problems.

So I want to ask wether there is a better way to set up a character or wether you can improve my thoughts.

I hope the question was easy to understand and I also hope that someone knows an answer.

Every help is much appreciated.

The easiest way is to have an empty game object (say, Weapon) childed to the hand bone. All possible weapons are childed to Weapon, each one previously adjusted to the correct position/rotation. Locate the object Weapon at Start and save a reference to it (or drag it to the reference variable at the Inspector). To select a weapon, deactivate all of the Weapon children and activate only the selected one with GameObject.SetActiveRecursively(onOff).

This works fine for compatible weapons, like rifle, machine gun, rocket launcher etc. but may seem weird when switching to a pistol or - even worse - to an axe or sword. In such cases, maybe the whole character should be switched - or at least its mesh (have not tested this).