# How would I move one object the same distance, on each finger swipe?

I have been looking around for quite a while now, and can’t seem to find any solutions that are straight forward.

I have a Quad, that moves to a certain point on the x axis, when i swipe right.
the same quad moves the opposite way, (back to where it was), when i swipe left.

Its only a “one swipe” action though, as you can see in my script.

``````var Slideleft : GameObject;

function Update () {

for (var touch : Touch in Input.touches)
var touchDelta : Vector3 = Input.GetTouch(0).deltaPosition;

if (touchDelta.x >6) {
Slideleft.transform.position = Vector3 (-0.19504918, 0.5, 2);
Debug.Log ("rightswipe");

}
if (touchDelta.x <-6) {
Slideleft.transform.position = Vector3(0.4681461, 0.5, 2);
Debug.Log ("leftswipe");

}
}
``````

So here it moving to the exact position (0.4681461, 0.5, 2)

I have been wanting it to move on the x axis, in steps.
Il try explain better.

Lets say I press a button “LEFT”, and it moves a plane to the left, just a tad.
If I press “LEFT” again, it nudges the object to the left again…just a tad".

If i press “RIGHT” it moves the same distance as left…but of course…Right.
The more I press it, the more its nudged.

0.5 units on the x axis is how much I want it to nudge each time to be precise.

( from the middle to the left )

Help would be greatly appreciated.

Cheers, Tim.

Im not really sure what exactly youre looking for…maybe something like this:

`````` Slideleft.transform.position += Vector3 (0.5, 0, 0);

and

Slideleft.transform.position -= Vector3 (0.5, 0, 0);
``````