Getting back to the set position

I have a simple script that lets my object (sphere) copy the moves of the stick of my Xbox 360 gamepad. It just emulates the stick: if I tilt it a little, my sphere moves a bit; if I release it, it goes back to origin. Thats perfect, that`s exactly what I need.

using UnityEngine;
using System.Collections;

public class Move : MonoBehaviour {
	public Transform target1;

	// Use this for initialization
	void Start () {
	// Update is called once per frame
	void FixedUpdate () {

				transform.LookAt (target1);

				transform.position = new Vector3 (Input.GetAxis ("Horizontar"), transform.position.y, transform.position.z);
				transform.position = new Vector3 (transform.position.x, transform.position.y, - Input.GetAxis ("Verticar"));



Now, what I want my sphere is to make the same moves, but LOCALLY, not necessarily returning to origin. I don`t know how to do that. With the script I showed you the sphere is always set at origin, when I start the game — no matter where I placed it in the editor.

Any help is appreciated.

Firstly understand that the code lines 21-22 in you code above can also be represented as:

Vector 3 input = new Vector3 (Input.GetAxis ("Horizontar"), transform.position.y, - Input.GetAxis ("Verticar"));
transform.position = input;

This results in a position that varies from (-1,0,-1) to (1,0,1) depending on input.

If you were instead to use this:

float scale = 0.1f;
Vector 3 input = new Vector3 (Input.GetAxis ("Horizontar"), transform.position.y, - Input.GetAxis ("Verticar"));
transform.Translate(input * scale);

It’s movement would be cumulative over each frame.

Play with the scale value to control the speed.