How do I attach weapon to my character without breaking animations

I resolved it, I connected the static mesh instead of the skeletal mesh and it worked.