Adding a weapon using the avatar instead of a specific bone

I want to attach weapons to my models, but I have about 50 different models in my game. Making weapon attachment points for each model is incredibly tedious, and whenever you want to make a minor change it has to be done manually for every model. Since all of my models are humanoid, it seems like there should be an easy way to attach the weapon to the humanoid avatar’s right hand so the location of the weapon would be exactly the same for every humanoid model.

Is there a way to access the location of an avatar’s right hand or access the bone associated with the “right hand” in the avatar?

Bug ups man,this worked 100%
private var Rhand : Transform;
private var anim : Animator;

anim = GetComponentInChildren(Animator);

Rhand = anim.GetBoneTransform(HumanBodyBones.RightHand);
Rgun.transform.parent = Rhand.transform;

2 Likes

Yeah it doesn’t seem like a lot of people know about it. Super useful.