Making TPS: how to link weapon model to player model?

Hello, community!
I creating a shooter (mostly for self-education purposes), I create player model (in Blender, model is rigged and ready for animation) and a bunch of weapon models. Now I want to put a weapons to player hands. I.e., I want to create in player model some kind of pivot, from which a weapon can inherit position and rotation. How can I do this?
(Sorry for possible stupid question, I didn’t find an answer by search)

If you know the game object from which the weapon needs to inherit the position and rotation, the simplest way to achieve it, is by making it a child of that game object and setting the local rotation and local position to zero.

Thanks, Dantus.
Could a part of model’s mesh or rig be a separated game object, or I need to add a new mesh for this purpose?

When you import the rigged model, you can select in the rig tab, whether you want to “Optimize Game Objects”.

If you optimize, all the bones won’t be in the hierarchy anymore. However, you can specify individual bones that should still be there. Either don’t optimize, or explicitly expose the bone you need. Like that you can use those bones to attach anything to them what you want.

1 Like

Hi.
Did you make a weapon mount bone, in the Players bones, in the palm of his hand?
eg.


This technique is a great one to use.
The weapon mount bone, is used to hold, rifles or swords, grenades etc. :smile:
That’s why it is pointed up like your thumb. :wink:

But will need to be masked if using humanoid rig and mocap animations. :wink: