number that crease and decrease

is there a function/argument that keeps going from 1 to -1?
and then from -1 to 1?

something like this:

0.0f,
0.1f,
.
.
.
0.9f,
1.0f,
0.9f,
0.8f,
0.7f,
.
.
.
0.1f,
0.0f,
-0.1f,
-0.2f,
-0.3f,
.
.
.
-0.9f,
-1.0f,
-0.9f,
-0.8f,
.
.
.
-0.1f,
0.0f,
.
.
.

it’s like a Lerp function

Yes. Mathf.PingPong.

Hello,
Try this;

#pragma strict
private var i : float = 0;
private var j : float = 0;

function Update ()
{
	j += 0.01;//Makes "i" value decrease and increase 0.01 each frame, you can change it to any number you want
	i = Mathf.PingPong(j, 2) - 1;
	print(i);
}

Mathf.PingPong(t, length);
The “t” value must not be constant, that’s why your variable keeps in some value.