Move character up and down while animation runs

Hello,

i got a question. I created a flappy bird clone with a tutorial but i want to add the death feature. When the player is death(collides), he has to move up a bit and then fall through the ground(like in mario).

I tried to use the code below but nothing happend. I think it is important to say that the death is an animation, because the bird turns from normal color into gray.

var pos = transform.position;
pos.y += 1;

Is there any possibility?

You never tell the object what its new position is, add the following line

transform.position=pos;

I would try to do this with

 Rigidbody2D.AddForce(new Vector2(0f, 1f),ForceMode2D.Impulse);