Hierarchy Fade Out

I would like to fade out a GameObject and all its children. I tryed that script, attached to the parent Object which i found here in the forum. it works, but the result is a fade in and a fade out. (it might be the Mathf.PingPong but i dont know.)
how can the script be changed to a simple fadeout?

Thank you!

var duration = 1.0;

function Update () {

var lerp = Mathf.PingPong(Time.time, duration) / duration;

var renderers = gameObject.GetComponentsInChildren (Renderer);

for (var rend : Renderer in renderers) {

rend.renderer.material.color.a = Mathf.Lerp (0.6, 0.0, lerp);
}
}

Drop PingPong as that bounces from value a to b then back to a (fade out then back in). Instead just track some variable (lerp percentage, time elapsed divided by the duration for example) and use a straight Lerp to go from visible to invisible on the various objects.

Thank you! now it works fine!