3rd person weapon equip

I’m having some trouble figuring out how to equip weapons in a 3rd person game. Following what I have found online, I have successfully attached the weapon model to my characters “hand” transform, the code looks like this:

public void Wield(Transform parent) {
		transform.parent = parent;
		transform.localPosition = Vector3.zero;
		transform.localRotation = Quaternion.identity;

The problem with this code is that whilst it does put the gun (or sword or whatever) in the players hands, I also need to specify a particular rotation and position offset for each weapon.

My solution to this was to add a dummy “WeaponSlot” transform to my characters hand and I and modify the rotation / position of this transform depending on which weapon has been equipped. For example, if the user equips a sword, I will rotate this transform so the sword is held upwards and not sideways and offset the y position so that he holds it by the handle and not in the middle of the blade like he currently does. This solution would mean storing a position offset Vector and a rotation Quaternion for each weapon class.

Is this the right way to do this? Are there any example projects online which handle the equipping of different types of weapons?

Was the simplest solution… Sometimes I work so long that my brain melts I guess, how couldn’t I have thought of this. Thanks!