Move object to position with keypress

Hi all.

I am trying to demonstrate how an object is assembled and would like to move an object slowly to a certain position with a key press.
And slowly move it back if i press the key again.

Could i maybe modify this Hide/Show object on key press script to do that?

You can achieve this using at least 2 approaches: using animation or moving object with code.
I will describe the second method.
In your Update method, on key down, you can switch between 2 different points: somethinbg like opened/closed positions. Then move your object using Vector3.MoveTowards static method to the target point by a certain distance eache frame (each Update call).