Moving GameObject To Set Distance Not Set Coordinate?

I’m using iTween to move a gameobject to the right. Basically when the gameobject dies I send it back to a spawnpoint then once the gameobject is returned, this iTween code moves him to the right at a set position in a certain amount of time. The problem is, I don’t want it to be a fixed end position which it seems iTween is forcing me to do which is a problem because the respawn point is always moving which causes the gameobject to move left once you pass the endPosition coordinate.

Instead I just want the gameobject to move to the right a certain distance, say 10 units or so every time it returns to the spawn point. Having a fixed endPosition won’t work for me.

This is the code I’m using. It does what I want but not exactly.

var endPosition : float = 0.0;
var moveTime : float = 0.0;

iTween.MoveTo(gameObject, {"x":endPosition, "time":moveTime, "easetype":"linear", "onComplete":"GoToThisFunction"});

Is there another way to write this or a more straight forward or easier way to move my gameobject to the right a certain distance without the need for a predefined end position with iTween?

If you want it to just instantly teleport 10 units to the right:
gameObject.transform.position+=new Vector3(10.0f,0.0f,0.0f);
if that is the wrong direction just change the 10 to either y or z

if you need it to move there gradually you need a CoRoutine like this:

    public float moveTime;

    IEnumerator MoveRight()
    {
        float currentTime = 0.0f;
        Vector3 originalPosition = this.transform.position;
        Vector3 destinationPosition = this.transform.position + new Vector3(10.0f, 0.0f, 0.0f);
        while (currentTime < moveTime)
        {
            currentTime += Time.deltaTime;
            this.transform.position = Vector3.Lerp(originalPosition, destinationPosition, currentTime / moveTime);
            yield return null;
        }
       
    }

    // Then some function has to call this:
    StartCoroutine(MoveRight());

}