Look into sockets. You would create a socket on the actual mesh where you would want your weapon. Then with the attachtocomponent function, there is a optional field where you can tell it to attach to the socket FName if it exists.
The other option is to attach it to the camera if its a first person shooter.