Make simple moving platform

I’ve looked this previously, but i can’t figure out how to make a platform move a few seconds, stop, then go back. I’m using UnityScript.

What i’m using right now is

function Start () 
{


}

function Update () 
{
	transform.Translate(Vector3.forward * Time.deltaTime);
}

This only makes it move forward without stopping or returning. I appreciate anyone taking the time to answer.

I think you want to use a Sine or Cosine function.
(I personally script in C#, but I assume it’s similar to this)

transform.Translate(transform.forward*Mathf.Cos (Time.time)*Time.deltaTime);

Mathf.PingPong is your friend…