How to blend a rotation animation with a position animation at key press but without restarting the position anim?

I have a GameObject with a “floating” animation that consists of moving vertically up and down. I want to make the object rotate 360 degrees (once) on key press, for which I have another animation “rotation”.

I configured the default layer on the Animator, and play the animation on c# on key press. However, when the object finishes rotating, it restarts the “idle” animation from y=0, which I don’t want.

How do I make the gameobject to keep floating and do the 360 rotation without restarting the idle animation.

Thank you

I’ll answer since it seems like this post have gotten little attention.

It’s good enough to have an Update() sine function to control the Y position of the gameobject. On key pressed, you can use LeanTween to rotate the gameobject once without altering the animation.