Simple spring with no physics?

Hello there~
Because the spring joint based on the physics and sometimes it"s not good for useing.
I want to write a simple spring script with no physics.
but i have no idea about it.
any tips?thanks~

// try this function (put this script on any object)

var my_height : float= 1;
var my_ang : float = 0;
function Update()
{
transform.position.y = my_height * Mathf.Abs( Mathf.Cos(my_ang) );
my_ang += .1;
}

// U can add the below line to make ur spring stop damping
// my_height *= .97;

Thank you so much~
It’s very useful~