How do I stop my character from moving, play effect, then return its velocity?

I’m working on an 2D endless run, when my character jumps to get the special item, I freeze my character using:

character.rb.bodyType = RigidbodyType2D.Static; character.IsMoving = false; character.currentAnimator.speed = 0;

then I play effect animation.
After the effect finish, I release my character:
character.rb.bodyType = RigidbodyType2D.Dynamic; character.IsMoving = true; character.currentAnimator.speed = 1;

But when I do this, my character instead of getting higher to original height, he falls.

Is there any way to solve this? Please teach me. Thanks in advanced.

You could store the velocity of the character, and apply it to the rigidbody after the animation has played.

// Get the velocity from the character before stopping everything
Vector3 velocityBefore = character.rb.velocity;

// Do animation stuff here
...
// Apply velocity from before the animations played
character.rb.velocity = velocityBefore;