how to adjust speed of my object ?

ok so here is my code

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

i need to adjust the speed but every time i try noting happens the object goes in the same speed

I don’t know why you are putting the -1.0 there, see here for description of ping pong: Unity - Scripting API: Mathf.PingPong this this code should work:

//speed that your object should travel multiplied by time
var speed : float = 1.0
function Update (){transform.position.x = Mathf.PingPong(Time.deltaTime * speed, 2.0);}