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: https://youtu.be/u0ToCToSQMs?t=694 The process I described is how I achieved these results.
Follow this question
Once you sign in you will be able to subscribe for any updates here