How do i make rigged meele weapons?

I want to make an unfolding meele weapon when equipped.

I’ve tried to connect to these parts Motor6Ds but it’s not very practical in rotating parts.
I would also like to play an animation for both, the character and the weapon, i just don’t know how to do it.

image
All help will be appriciated!

If you have any questions, Ask me of course.

You can try to add bone armature in blender it might work save it as sbf file