attaching/changing weapons in a character's hand

Hi there

can I just get an idea of how to attach/change a weapon in a character’s hand. How would this be done?

thanks

Well, they handle it very well in the fps tutorial. This is a code snippet from the tutorial that handles changing the weapons.

function SelectWeapon (index : int) 
{
	for (var i=0;i<transform.childCount;i++)
	{
		// Activate the selected weapon
		if (i == index)
			transform.GetChild(i).gameObject.SetActiveRecursively(true);
		// Deactivate all other weapons
		else
			transform.GetChild(i).gameObject.SetActiveRecursively(false);
	}
}

The script goes on a empty GO and then you add the weapon prefabs under that GO. Then when you call SelectWeapon(), it activates the weapon you put in the index and deactivates the other weapons. You can get a better idea by looking into the fps tutorial.