it was done in 2d, but you could easily make it work in 3d too! The gun just uses a sprite stack, but you may want to even use a mesh as well! :)
We solved this problem by creating a 3D model and rotating it based on the 2D character.
Thank you.
https://drive.google.com/file/d/1_t9Tu31ejx6i2yqtVTnTTlAreAFYrIEL/view?usp=drive...