Mathf.PingPong(Time.time, a)is not start from 0

i try to Instantiate a game object during the game,and using

transform.position.x=Mathf.PingPong(Time.time, a);

to make it move around, but that game object always jump away in the frame right after i Instantiate it, in other word

Debug.Log(Mathf.PingPong(Time.time, 3));

in Update() is not always 0,anybody know why? how to fix it?

Just to put what Bonfire said into an example:

// I assume you use UnityScript? Assumption based on "transform.position.x ="

private var startTime : float = 0.0;

function Start()
{
    startTime = Time.time;
}

function Update()
{
    transform.position.x = Mathf.PingPong(Time.time - startTime, 3);
}

Another solution is to not use Time.time but use your own counter and let it start at 0:

private var counter : float = 0.0;

function Update()
{
    counter += Time.deltaTime;
    transform.position.x = Mathf.PingPong(counter, 3);
}