Sword doesn

Hello,
I am using a c++ animation instance class to play an attack animation montage, but the sword that is attached to the player doesn’t move at all when I use the animation in the game, but it moves accordingly, when I sprint, jump or dash. The Sprint, jump and Dash animations are played from within the animation blueprint for the character. How would I be able to get the sword to stay attached to the socket while the attack animation montage is played?

Thank you in advance.

@NilsonLima The sword gets attached to the character from within the characters c++ file. I thought the sockets would automatically move according to the animation as well, so anything that gets attached to the socket would get animated as well. I seem to be wrong in that case. Would I have to animate the sword itself, create an animation montage and have it played at the same time as the animation montage of the player?