# InverseTransformPoint

> Transforms position from world space to local space.

## Definition

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

## InverseTransformPoint(Vector3)

Transforms position from world space to local space.

```csharp
public Vector3 InverseTransformPoint(Vector3 position)
```

### Parameters

**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)):&#x20;

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector3](/engine/6000.0/script-reference/unityengine/vector3.md) |             |

### Remarks

This function is essentially the opposite of [Transform.TransformPoint](/engine/6000.0/script-reference/unityengine/transform/transformpoint.md) which is used to convert from local to world space.

Note that the returned position is affected by scale. Use [Transform.InverseTransformDirection](/engine/6000.0/script-reference/unityengine/transform/inversetransformdirection.md) if you are dealing with direction vectors rather than positions.

If you need to transform many points at once consider using [Transform.InverseTransformPoints](/engine/6000.0/script-reference/unityengine/transform/inversetransformpoints.md) instead as it is much faster than repeatedly calling this function.

```csharp
// Calculate the transform's position relative to the camera.
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    public Transform cam;
    public Vector3 cameraRelative;

    void Start()
    {
        cam = Camera.main.transform;
        Vector3 cameraRelative = cam.InverseTransformPoint(transform.position);

        if (cameraRelative.z > 0)
            print("The object is in front of the camera");
        else
            print("The object is behind the camera");
    }
}
```

Additional Resources:[Transform.TransformPoint](/engine/6000.0/script-reference/unityengine/transform/transformpoint.md), [Transform.InverseTransformPoints](/engine/6000.0/script-reference/unityengine/transform/inversetransformpoints.md), [Transform.InverseTransformDirection](/engine/6000.0/script-reference/unityengine/transform/inversetransformdirection.md), [Transform.InverseTransformVector](/engine/6000.0/script-reference/unityengine/transform/inversetransformvector.md).

## InverseTransformPoint(float, float, float)

Transforms the position x, y, z from world space to local space.

```csharp
public Vector3 InverseTransformPoint(float x, float y, float z)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector3](/engine/6000.0/script-reference/unityengine/vector3.md) |             |

### Remarks

This function is essentially the opposite of [Transform.TransformPoint](/engine/6000.0/script-reference/unityengine/transform/transformpoint.md) which is used to convert from local to world space.

Note that the returned position is affected by scale. Use [Transform.InverseTransformDirection](/engine/6000.0/script-reference/unityengine/transform/inversetransformdirection.md) if you are dealing with direction vectors rather than positions.

If you need to transform many points at once consider using [Transform.InverseTransformPoints](/engine/6000.0/script-reference/unityengine/transform/inversetransformpoints.md) instead as it is much faster than repeatedly calling this function.

```csharp
// Calculate the world origin relative to this transform.
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        Vector3 relativePoint = transform.InverseTransformPoint(0, 0, 0);

        if (relativePoint.z > 0)
            print("The world origin is in front of this object");
        else
            print("The world origin is behind this object");
    }
}
```

Additional Resources:[Transform.TransformPoint](/engine/6000.0/script-reference/unityengine/transform/transformpoint.md), [Transform.InverseTransformPoints](/engine/6000.0/script-reference/unityengine/transform/inversetransformpoints.md), [Transform.InverseTransformDirection](/engine/6000.0/script-reference/unityengine/transform/inversetransformdirection.md), [Transform.InverseTransformVector](/engine/6000.0/script-reference/unityengine/transform/inversetransformvector.md).
