Is it better to create extra joints for animating weapons with a character?

Or is it better to keep the weapons as separate meshe’s with its own bones / skeleton?
For example If I want to animate a character tossing a gun in the air, should I give the character extra bones and skin the gun to the weapon bones of the character skeleton?
The problem this method might have is, I dont always want the weapon to show.
So, if I’m not always holding the weapon, should I make the weapon its own bones / skeleton and animate that to be in sync with the character animation? And play 2 separate skeletons together?

You should usually make the weapon a separate skeletal mesh.
I am a not an expert on the subject myself, so I’m sure there are better ways, but my approach was to rig the gun and character separately, and then, in my 3D application, I placed the gun and the arms in the same scene and animated the arms whilst moving the gun along with them, maintaining the position the weapon would be seen in game.
After I’d made several animations, I’d export the arms only. The guns were exported separately.

Then, back in UE4 I add sockets to the hands to which the guns are attached, so that when the arms are animated, the weapon moves along with them via forward kinematics.

Sockets are key here. They’re also useful for a range of other things, such as adding removable magazines for reload animations as well as positions for spawning particle effects, like muzzle flash.

I could probably offer some more advice later if required, when I have time, along with images if necessary.
Good luck.

edit: I was responsible for animation in this project: Project Q, The Development - YouTube
The process I described is how I achieved these results.

Wow, thanks so much for that great answer! The animations you did on that look really awesome.
So its pretty easy to play the animations together with blueprints if they are in sync in Maya?
I haven’t imported any animated weapons into unreal yet, only static, so I will have to test it out.

If you haven’t already, take a look at the Animation Blueprint. It;s really quite powerful and possibly one of the best part of the engine, but it definitely has a fairly steep learning curve.

My suggestion: do a few rough animations first, and then import them and see how things go. You will probably need to improve on your workflow a bit by making a second pass once you’ve got a handle on the basics.

Here, I’ve just uploaded my project report: Google Drive: Sign-in

It’s both lengthy and missing information, due to a restrictive word count, but hopefully there’s a gem of knowledge that could be useful to you. It is a report, not a full on tutorial. The section that concerns the animation BP is 5.Implementation

I’d just like to stress again, that I am a relative novice, and developed this approach alongside the team’s lead programmer, who had even less animation experience than myself! =P