# position

> The world space position of the Transform.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public Vector3 position { get; set; }
```

### Remarks

The [TransformHandle.position](/engine/6000.7/script-reference/unityengine/transformhandle/position.md) property of a [GameObject](/engine/6000.7/script-reference/unityengine/gameobject.md)’s [Transform](/engine/6000.7/script-reference/unityengine/transform.md), which is accessible in the Unity Editor and through scripts. Alter this value to move a [GameObject](/engine/6000.7/script-reference/unityengine/gameobject.md). Get this value to locate the [GameObject](/engine/6000.7/script-reference/unityengine/gameobject.md) in 3D world space.

For more information about the position and axis, refer to struct-TransformHandle.

You need to instantiate the object in the scene so that it can move on change. Prefab assets are still [GameObject](/engine/6000.7/script-reference/unityengine/gameobject.md), but they are not instantiated. For this reason, Unity doesn't use the data from the [TransformHandle](/engine/6000.7/script-reference/unityengine/transformhandle.md) [TransformHandle.position](/engine/6000.7/script-reference/unityengine/transformhandle/position.md) of the root asset of the Prefab hierarchy.

```csharp
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    //movement speed in units per second
    private float movementSpeed = 5f;

    void Update()
    {
        //get the Input from Horizontal axis
        float horizontalInput = Input.GetAxis("Horizontal");
        //get the Input from Vertical axis
        float verticalInput = Input.GetAxis("Vertical");

        TransformHandle thisTransformHandle = transformHandle;

        //update the position
        thisTransformHandle.position = thisTransformHandle.position + new Vector3(horizontalInput * movementSpeed * Time.deltaTime, verticalInput * movementSpeed * Time.deltaTime, 0);

        //output to log the position change
        Debug.Log(thisTransformHandle.position);
    }
}
```

This example gets the Input from Horizontal and Vertical axes and moves the GameObject up/down or left/right by changing its position.

Another example:

```csharp
using UnityEngine;

public class ExampleClass2 : MonoBehaviour
{
    //movement speed in units per second
    private float distance = 5f;
    public GameObject prefabToInstantiate;

    void Start()
    {
        if (prefabToInstantiate != null)
            InstantiateAbove(prefabToInstantiate);
    }

    void InstantiateAbove(GameObject prefab)
    {
        //instantiate above at the given distance
        Vector3 offset = new Vector3(0, distance, 0);
        GameObject.Instantiate(prefab, transformHandle.position + offset, Quaternion.identity);
    }
}
```

This example instantiates the given prefab 5 units above the position of the GameObject using this script.
