adding objects to bones`

I was woundering how you go about adding objects to bones, like if you were to make a mech rig. I can’t figure it out, I know how to attach a mesh to an armature but don’t know how to attach a object to just a bone so that it stays with that bone

short awnser is to use weight painting on your mesh with the certain bone selected that probably wont help much so read this:

No, weight painting has nothing to do with parenting an object/mesh to an armature bone …

To do that simply Ctrl-Tab into Pose Mode with the armature selected then select the object/mesh you want to parent to a bone then shift-select the bone you want to be the parent and Ctrl-P -> “MakeParent to” -> Bone .